for example I have a common.js , and regagent.js, how can I minify them without combine them these two, because mix.copy and mix.scripts seems can't do it?
1 Answer
Just use separate scripts() methods for every file:
elixir(function(mix) {
mix.scripts([
'resources/assets/js/admin.js',
], 'public/js/admin.js', './');
mix.scripts([
'resources/assets/js/main.js',
], 'public/js/main.js', './');
}
Then run gulp --production command to minify each file.
2 Comments
Yiu Kitman
But If I have 10+ files then I have to do that as well ?
Alexey Mezenin
@YiuKitman gulpfule.js is JS, so minify files inside a JS loop.