rollup-plugin-auto-external
rollup-plugin-auto-external copied to clipboard
@babel/polyfill support
Hi, seem like rollup-plugin-auto-external
doesn't support dependencies' dependencies. When I include @babel/polyfill
in dependencies, It also require('core-js')
in final bundle.
"dependencies": {
"@babel/polyfill": "^7.0.0", // it will require `core-js`
"@babel/runtime": "^7.1.5"
}
Then I get a warning here:
'core-js/modules/es6.array.iterator' is imported by xxx.ts, but could not be resolved – treating it as an external dependency
That's what I did temporarily.
external: id => {
try {
require(id) // Exited in node_modules
return true
} catch (e) {}
}
rollup-plugin-babel-runtime-external should do the trick for you. Care to give it a go and tell me how it went?