Closed adnanfajlur closed 4 years ago
Okay so after a bit of experimenting, I've found this happens because of the @rollup/plugin-node-resolve
plugin.
When Rollup needs to bundle packages from node_modules
, this plugin will mess up the directory structure of our output. In this case, it's bundling tslib
(you can see this under node_modules
in build
).
To solve this, you can:
tslib
to the external
field in rollup.config.js
, peerDependencies
in package.json
(This will prevent tslib
from being bundled because of the peerDepsExternal
plugin.)@rollup/plugin-node-resolve
I've updated the branch without the @rollup/plugin-node-resolve
plugin which has fixed the issue. The downside of removing this plugin is that our bundle won't be able to benefit from Node Resolution Algorithm
it works dude, thanks 😁👌
@HarveyD Can you explain this?
The downside of removing this plugin is that our bundle won't be able to benefit from Node Resolution Algorithm.
What we are exactly lost in after remove resolve()
from plugins for code splitting?
got incorrect build with
...args
on componentsuccess without
...args
thanks