Changeset View
Changeset View
Standalone View
Standalone View
src/webpack.mix.js
Show All 9 Lines | |||||
| | | | ||||
*/ | */ | ||||
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({ | ||||
/* | |||||
mollekopf: Maybe just delete this if we no longer require it? | |||||
output: { | output: { | ||||
publicPath: process.env.MIX_ASSET_PATH, | publicPath: process.env.MIX_ASSET_PATH, | ||||
// Make sure chunks are also put into the public/js/ folder | // Make sure chunks are also put into the public/js/ folder | ||||
chunkFilename: "js/[name].js" | chunkFilename: "js/[name].js" | ||||
}, | }, | ||||
optimization: { | optimization: { | ||||
splitChunks: { | splitChunks: { | ||||
// Disable chunking, so we have one chunk.js instead of chunk.js + vendor~chunk.js | // Disable chunking, so we have one chunk.js instead of chunk.js + vendor~chunk.js | ||||
maxAsyncRequests: 1 | maxAsyncRequests: 1 | ||||
} | } | ||||
}, | }, | ||||
*/ | |||||
resolve: { | resolve: { | ||||
alias: { | alias: { | ||||
'jquery$': 'jquery/dist/jquery.slim.js', | 'jquery$': 'jquery/dist/jquery.slim.js', | ||||
} | } | ||||
} | } | ||||
}) | }) | ||||
mix.js('resources/js/user.js', 'public/js') | mix.js('resources/js/user.js', 'public/js').vue() | ||||
.js('resources/js/admin.js', 'public/js') | .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/') | ||||
mix.sass(fromDir + 'app.scss', toDir) | mix.sass(fromDir + 'app.scss', toDir) | ||||
.sass(fromDir + 'document.scss', toDir); | .sass(fromDir + 'document.scss', toDir); | ||||
fs.stat(fromDir + 'images', {}, (err, stats) => { | fs.stat(fromDir + 'images', {}, (err, stats) => { | ||||
if (stats) { | if (stats) { | ||||
mix.copyDirectory(fromDir + 'images', toDir + 'images') | mix.copyDirectory(fromDir + 'images', toDir + 'images') | ||||
} | } | ||||
}) | }) | ||||
}) | }) |
Maybe just delete this if we no longer require it?