diff --git a/makefile b/makefile index 3e5d349..9ed17a0 100644 --- a/makefile +++ b/makefile @@ -4,5 +4,5 @@ build: serve: npx webpack serve --no-open -dev-server: +serve-dist: python -m http.server --directory dist/ 8700 diff --git a/webpack.config.js b/webpack.config.js index 1ee1bf9..d85f890 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -19,15 +19,24 @@ module.exports = { ], output: { clean: true, - filename: '[name].bundle.js', + filename: '[name].[contenthash].bundle.js', path: relpath('dist'), }, devServer: { static: relpath('dist'), }, optimization: { - // fixes problems when bundling more than one entry + moduleIds: 'deterministic', runtimeChunk: 'single', + splitChunks: { + cacheGroups: { + vendor: { + test: /[\\/]node_modules[\\/]/, + name: 'vendors', + chunks: 'all', + }, + }, + }, }, performance: { // hides the performance warnings for now