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 { exec } = require('child_process'); | const { spawn } = require('child_process'); | ||||
const fs = require('fs'); | const fs = require('fs'); | ||||
const glob = require('glob'); | const glob = require('glob'); | ||||
const mix = require('laravel-mix'); | const mix = require('laravel-mix'); | ||||
mix.webpackConfig({ | mix.webpackConfig({ | ||||
resolve: { | resolve: { | ||||
alias: { | alias: { | ||||
'jquery$': 'jquery/dist/jquery.slim.js', | 'jquery$': 'jquery/dist/jquery.slim.js', | ||||
} | } | ||||
} | } | ||||
}) | }) | ||||
mix.before(() => { | mix.before(() => { | ||||
exec('php resources/build/before.php') | spawn('php', ['resources/build/before.php'], { stdio: 'inherit' }) | ||||
}) | }) | ||||
mix.js('resources/js/user.js', 'public/js').vue() | mix.js('resources/js/user.js', 'public/js').vue() | ||||
.js('resources/js/admin.js', 'public/js').vue() | .js('resources/js/admin.js', 'public/js').vue() | ||||
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/') | ||||
Show All 9 Lines |