Changeset View
Changeset View
Standalone View
Standalone View
src/webpack.mix.js
/* | /* | ||||
|-------------------------------------------------------------------------- | |-------------------------------------------------------------------------- | ||||
| Mix Asset Management | | Mix Asset Management | ||||
|-------------------------------------------------------------------------- | |-------------------------------------------------------------------------- | ||||
| | | | ||||
| Mix provides a clean, fluent API for defining some Webpack build steps | | Mix provides a clean, fluent API for defining some Webpack build steps | ||||
| for your Laravel application. By default, we are compiling the Sass | | for your Laravel application. By default, we are compiling the Sass | ||||
| file for the application as well as bundling up all the JS files. | | file for the application as well as bundling up all the JS files. | ||||
| | | | ||||
*/ | */ | ||||
const { spawn } = require('child_process'); | const { spawn } = require('child_process'); | ||||
const glob = require('glob'); | const glob = require('glob'); | ||||
const mix = require('laravel-mix'); | const mix = require('laravel-mix'); | ||||
mix.js('resources/js/user/app.js', 'public/js/user.js').vue() | mix.options({ | ||||
.js('resources/js/admin/app.js', 'public/js/admin.js').vue() | vue: { | ||||
.js('resources/js/reseller/app.js', 'public/js/reseller.js').vue() | compilerOptions: { | ||||
whitespace: 'condense' | |||||
} | |||||
} | |||||
}) | |||||
mix.js('resources/js/user/app.js', 'public/js/user.js') | |||||
.js('resources/js/admin/app.js', 'public/js/admin.js') | |||||
.js('resources/js/reseller/app.js', 'public/js/reseller.js') | |||||
.vue() | |||||
mix.before(() => { | mix.before(() => { | ||||
spawn('php', ['resources/build/before.php'], { stdio: 'inherit' }) | spawn('php', ['resources/build/before.php'], { stdio: 'inherit' }) | ||||
}) | }) | ||||
glob.sync('resources/themes/*/', {}).forEach(fromDir => { | glob.sync('resources/themes/*/', {}).forEach(fromDir => { | ||||
const toDir = fromDir.replace('resources/themes/', 'public/themes/') | const toDir = fromDir.replace('resources/themes/', 'public/themes/') | ||||
mix.sass(fromDir + 'app.scss', toDir) | mix.sass(fromDir + 'app.scss', toDir) | ||||
.sass(fromDir + 'document.scss', toDir); | .sass(fromDir + 'document.scss', toDir); | ||||
}) | }) |