Answer the question
In order to leave comments, you need to log in
Where to run laravel front build?
Can you help me figure out where to run npm run prod in Laravel, in the local environment or on the server itself? Who does what?
webpack.mix.js
const mix = require('laravel-mix');
//front
mix.js('resources/js/app.js', 'public/js');
mix.sass('resources/sass/front/app.sass', 'public/css');
mix.copyDirectory('resources/fonts', 'public/fonts');
mix.copyDirectory('resources/images', 'public/images');
//dashboard
mix.js('resources/js/dashboard.js', 'public/js');
mix.sass('resources/sass/dashboard/dashboard.sass', 'public/css');
if (mix.inProduction()) {
mix.version();
mix.minify('public/js/app.js');
mix.minify('public/css/app.css');
} else{
mix.browserSync("http://site.loc/");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question