How to extract vendors into separate bundle with Parcel manualSharedBundles #9620
Replies: 2 comments 1 reply
-
In your configuration, you have set the |
Beta Was this translation helpful? Give feedback.
-
I was also trying and failing to do this. Here's my reproduction steps: package.json {
"name": "repro",
"version": "1.0.0",
"@parcel/bundler-default": {
"manualSharedBundles": [
{
"name": "vendor",
"assets": [
"node_modules/**/*"
],
"types": [
"js"
]
}
]
},
"source": "./src/index.js",
"targets": {
"main": {
"includeNodeModules": true
}
},
"dependencies": {
"add-two-numbers-for-testing": "^1.0.0"
},
"devDependencies": {
"parcel": "^2.12.0"
}
} src/index.js import addNumber from 'add-two-numbers-for-testing';
console.log(addNumber(1, 2)); I build via |
Beta Was this translation helpful? Give feedback.
-
In Parcel 2.12.0 a Manual shared bundles feature was introduced
Can Manual shared bundles be used to extract vendors (React, Ant Design, etc.) to a separate bundle?
Like it can be done with WebPack and SplitChunksPlugin?
The following config doesn't work, there is still a single huge bundle:
Or is creating a dummy
duplicate.tsx
still the only way to extract vendors to a separate bundle as described in this discussion?Beta Was this translation helpful? Give feedback.
All reactions