2

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 1

4

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.

Sign up to request clarification or add additional context in comments.

2 Comments

But If I have 10+ files then I have to do that as well ?
@YiuKitman gulpfule.js is JS, so minify files inside a JS loop.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.