diff --git a/.gitignore b/.gitignore index e29169c..506e98f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .netlify -build +dist node_modules \ No newline at end of file diff --git a/client/index.html b/client/index.html index cec3993..250c93b 100644 --- a/client/index.html +++ b/client/index.html @@ -7,7 +7,6 @@
- @@ -30,10 +42,38 @@ module.exports = { }, devtool: 'cheap-module-eavl-source-map', devServer: { - contentBase: path.join(__dirname, 'build'), + contentBase: path.join(__dirname, 'dist'), historyApiFallback: true, }, - plugins: [ - new BundleAnalyzerPlugin(), - ], + plugins, + // See https://webpack.js.org/guides/caching/ + optimization: { + runtimeChunk: 'single', + moduleIds: 'hashed', + splitChunks: { + chunks: 'all', + maxInitialRequests: Infinity, + minSize: 0, + cacheGroups: { + vendor: { + // sync + async chunks + chunks: 'all', + name: 'vendors', + // import file path containing node_modules + test: /[\\/]node_modules[\\/]/, + priority: 20, + }, + /* + common: { + name: 'common', + minChunks: 2, + chunks: 'all', + priority: 10, + reuseExistingChunk: true, + enforce: true, + }, + */ + }, + }, + }, };