-
Notifications
You must be signed in to change notification settings - Fork 362
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
Maybe should compile node_modules
with babel when use inline dependencies
#936
Comments
The rollup officials not recommend use untranspiled ES6 features to the module, but some authors don't think so, such as |
@developit @rschristian How do you feel about this? |
This makes a lot of sense in my opinion specifically for inlined dependencies. If the inlined dependency is not transpiled, this means the application needs to re-transpile a library built by microbundle. Wouldn't that make using non-modern mode for this library irrelevant, if it contains a mix of transpiled and untranspiled code in the bundle? |
FWIW I am in favor of this. My preference would be to run the "modern to legacy" portion of the JS transpilation on bundles, rather than on source files, similar to the setup described in this diagram: |
Same issue here, such as query-string release es6 code to npm : https://github.com/sindresorhus/query-string/issues?q=es5 |
may I ask what's the solution for this? Meet the same issue and I want to transpile the specific package in node_modules. |
There's no built-in/automatic solution for the moment, but you can, post-build, run Babel over your bundles to remove any erroneous modern features. |
Now microbundle is use
exclude: 'node_modules/**'
to create babel config, I think it's reasonable when not inline dependencies.But if use inline dependencies... this options maybe is weird?
Then add
foo
module todevDependencies
.Result:
If i use inline dependencies mean i hope it's part of mine module, my modules arrow function has compile (it's right) but
foo
modules has nothing change.Maybe should not set
exclude: 'node_modules/**'
when use inline dependencies?The text was updated successfully, but these errors were encountered: