add caching and hashing
This commit is contained in:
parent
f1acb9fe99
commit
1bc2a1a8ce
2
makefile
2
makefile
@ -4,5 +4,5 @@ build:
|
|||||||
serve:
|
serve:
|
||||||
npx webpack serve --no-open
|
npx webpack serve --no-open
|
||||||
|
|
||||||
dev-server:
|
serve-dist:
|
||||||
python -m http.server --directory dist/ 8700
|
python -m http.server --directory dist/ 8700
|
||||||
|
@ -19,15 +19,24 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
output: {
|
output: {
|
||||||
clean: true,
|
clean: true,
|
||||||
filename: '[name].bundle.js',
|
filename: '[name].[contenthash].bundle.js',
|
||||||
path: relpath('dist'),
|
path: relpath('dist'),
|
||||||
},
|
},
|
||||||
devServer: {
|
devServer: {
|
||||||
static: relpath('dist'),
|
static: relpath('dist'),
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
// fixes problems when bundling more than one entry
|
moduleIds: 'deterministic',
|
||||||
runtimeChunk: 'single',
|
runtimeChunk: 'single',
|
||||||
|
splitChunks: {
|
||||||
|
cacheGroups: {
|
||||||
|
vendor: {
|
||||||
|
test: /[\\/]node_modules[\\/]/,
|
||||||
|
name: 'vendors',
|
||||||
|
chunks: 'all',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
performance: {
|
performance: {
|
||||||
// hides the performance warnings for now
|
// hides the performance warnings for now
|
||||||
|
Loading…
Reference in New Issue
Block a user