A
A
Alexander2018-12-10 02:11:55
webpack
Alexander, 2018-12-10 02:11:55

How to collect several different js/css files in Laravel?

How can I collect several different js and css files? For example, for the admin panel, some scripts and styles are needed, for the main site others, and in fact there is no point in stuffing everything into one app.js and app.css.
Tried like this:

mix.js(['resources/js/app.js', 'resources/js/admin.js'], 'public/js')

But he just takes both files, and the output is one.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hakkol, 2018-12-10
@smoyke

mix.js('resources/js/app.js', 'public/js')
    .js('resources/js/admin.js', 'public/js')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question