N
N
nikitakarpenko2018-06-10 15:21:52
css
nikitakarpenko, 2018-06-10 15:21:52

Obfuscate, compress, concatenate js, css with gulp?

You need to glue and make a file in one line!
I know uglufy compresses, did I understand correctly that it makes a file in one line?
concatenate concatenates files.
What gulp packages do you use or have used?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ihor Bratukh, 2018-06-10
@nikitakarpenko

uglify is enough to minify a js file.
For concatenation, I use gulp-js-import in order to more flexibly manage the insertion of js files, for example . Another very useful plugin for me is gulp-file-include . With it, you can embed files in both html and js. I had a task to set styles through js, using this plugin I wrote styles in sass, gulp-sass generated a minified css file and using this plugin I inserted css with a js variable, it turned out very convenient.

var style = '@@include('./modules/airbender/style.css')';
$('head').append('<style type="text/css">'+ style +'</style>');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question