Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit unsure about the maxSize. The taskpane is now split in over 100 chunks. While this is more performant during local development, I suspect this actually performs worse if you add real latency when deployed to a server. However, I'm not sure how to test it at the moment. Should we wait until I've fixed the deployment to azure (hopefully in the next few days)?

minChunks: 1,
maxAsyncRequests: 30,
maxInitialRequests: 30,
automaticNameDelimiter: '~',
enforceSizeThreshold: 50000,
cacheGroups: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of these seem to be the default values. I think its more maintainable if only non-default values are specified, or is it necessary to specify everything?

defaultVendors: {
test: /[\\/]node_modules[\\/]/,
priority: -10,
reuseExistingChunk: true,
},
default: {
minChunks: 2,
priority: -20,
reuseExistingChunk: true,
},
},
},
},
output: {
path: path.resolve(__dirname, 'dist'),
},
Expand Down