Skip to content

Commit

Permalink
fix(webpack): Only do splitChunks:all on prod
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed May 10, 2024
1 parent f174bef commit 54b5310
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const thirdparty = gulp.parallel(mocha)

const assets = gulp.parallel(html, thirdparty, icons)

const build = gulp.parallel(assets, js)
const build = gulp.series(js, assets)

const main = gulp.series(build, native)

Expand Down
3 changes: 0 additions & 3 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ module.exports = {
test: path.join(__dirname, 'src', 'entries', 'test.js'),
native: path.join(__dirname, 'src', 'entries', 'native.js'),
},
optimization: {
splitChunks: { chunks: 'all' },
},
output: {
path: path.resolve(__dirname, 'dist', 'js'),
publicPath: '/dist/js/',
Expand Down
3 changes: 3 additions & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const webpack = require('webpack')
module.exports = merge(common, {
mode: 'development',
devtool: 'cheap-module-source-map',
optimization: {
splitChunks: { chunks: 'async' },
},
plugins: [
new webpack.DefinePlugin({
'DEBUG': JSON.stringify(true)
Expand Down
3 changes: 3 additions & 0 deletions webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const webpack = require('webpack')
module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
optimization: {
splitChunks: { chunks: 'all' },
},
plugins: [
new webpack.DefinePlugin({
DEBUG: JSON.stringify(!process.env['CI'])
Expand Down

0 comments on commit 54b5310

Please sign in to comment.