Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle size #340

Closed
H1dEx opened this issue Feb 7, 2022 · 4 comments
Closed

Bundle size #340

H1dEx opened this issue Feb 7, 2022 · 4 comments

Comments

@H1dEx
Copy link

H1dEx commented Feb 7, 2022

The final bundle weighs more than 5 MB. I guess, the problem is that it includes minified and regular versions. Dist folder weighs 3.3MB
image

@jaywcjlove
Copy link
Member

Include all code highlighting
@H1dEx

@jaywcjlove
Copy link
Member

image

@jaywcjlove
Copy link
Member

conf.optimization = {
...conf.optimization,
splitChunks: {
cacheGroups: {
reactvendor: {
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
name: 'react-vendor',
chunks: 'all',
},
katex: {
test: /[\\/]node_modules[\\/](katex)[\\/]/,
name: 'katex-vendor',
chunks: 'all',
},
mermaid: {
test: /[\\/]node_modules[\\/](mermaid)[\\/]/,
name: 'mermaid-vendor',
chunks: 'all',
},
dagred3: {
test: /[\\/]node_modules[\\/](dagre-d3)[\\/]/,
name: 'dagre-d3-vendor',
chunks: 'all',
},
momentlodash: {
test: /[\\/]node_modules[\\/](moment-mini|lodash|d3-array|d3-geo|d3-shape|dagre)[\\/]/,
name: 'momentlodash-vendor',
chunks: 'all',
},
d3: {
test: /[\\/]node_modules[\\/](d3-\w+(-?\w+))[\\/]/,
name: 'd3-vendor',
chunks: 'all',
},
micromark: {
test: /[\\/]node_modules[\\/](micromark)[\\/]/,
name: 'micromark-vendor',
chunks: 'all',
},
prismjs: {
test: /[\\/]node_modules[\\/](refractor)[\\/]/,
name: 'refractor-prismjs-vendor',
chunks: 'all',
},
runtime: {
test: /[\\/]node_modules[\\/](@babel[\\/]runtime)[\\/]/,
name: 'babel-runtime-vendor',
chunks: 'all',
},
parse5: {
test: /[\\/]node_modules[\\/](parse5)[\\/]/,
name: 'parse5-vendor',
chunks: 'all',
},
},
},
};

@jaywcjlove
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants