Skip to content

Commit

Permalink
fix: reduce bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh committed Nov 29, 2023
1 parent 615daa4 commit 396bf70
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/ui/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ module.exports = {
entry: ['./src/index.tsx'],
output: {
path: path.resolve(__dirname, './dist/static'),
filename: `[name]${isProd ? '.[contenthash]' : ''}.js`,
filename: `[name]${isProd ? '.[contenthash:10]' : ''}.js`,
publicPath: `${!isProd ? `http://localhost:${devServerPort}/` : 'auto'}`,
chunkFilename: '[contenthash].chunk.js',
chunkFilename: '[contenthash:10].chunk.js',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
Expand Down Expand Up @@ -71,7 +71,6 @@ module.exports = {
},
optimization: {
minimizer: [isProd && `...`, isProd && new CssMinimizerPlugin()].filter(Boolean),
chunkIds: 'named',
splitChunks: {
hidePathInfo: true,
cacheGroups: {
Expand All @@ -80,7 +79,6 @@ module.exports = {
chunks: 'initial',
name: 'vendor',
priority: 10,
enforce: true,
},
},
},
Expand All @@ -90,8 +88,8 @@ module.exports = {
['process.env.APP_VERSION']: JSON.stringify(pkg.version),
}),
new MiniCssExtractPlugin({
filename: '[name].[contenthash].css',
chunkFilename: '[contenthash].chunk.css',
filename: '[name].[contenthash:10].css',
chunkFilename: '[contenthash:10].chunk.css',
}),
new HtmlWebpackPlugin({
filename: path.resolve(__dirname, './dist/index.ejs'),
Expand Down

0 comments on commit 396bf70

Please sign in to comment.