diff --git a/webpack.config.js b/webpack.config.js index 0ce7d5e6..efa7d2b3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -26,6 +26,30 @@ module.exports = async (env, options) => { taskpane: ['react-hot-loader/patch', './src/taskpane/index.tsx'], commands: './src/commands/commands.ts', }, + optimization: { + splitChunks: { + chunks: 'all', + minSize: 20000, + maxSize: 50000, + minChunks: 1, + maxAsyncRequests: 30, + maxInitialRequests: 30, + automaticNameDelimiter: '~', + enforceSizeThreshold: 50000, + cacheGroups: { + defaultVendors: { + test: /[\\/]node_modules[\\/]/, + priority: -10, + reuseExistingChunk: true, + }, + default: { + minChunks: 2, + priority: -20, + reuseExistingChunk: true, + }, + }, + }, + }, output: { path: path.resolve(__dirname, 'dist'), },