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

@babel/polyfill support #11

Open
jeremy-ww opened this issue Mar 14, 2019 · 1 comment
Open

@babel/polyfill support #11

jeremy-ww opened this issue Mar 14, 2019 · 1 comment

Comments

@jeremy-ww
Copy link

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) {}
}
@stevenbenisek
Copy link
Owner

rollup-plugin-babel-runtime-external should do the trick for you. Care to give it a go and tell me how it went?

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