Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

es to es #14

Closed
jdalton opened this issue Dec 31, 2015 · 6 comments
Closed

es to es #14

jdalton opened this issue Dec 31, 2015 · 6 comments

Comments

@jdalton
Copy link
Member

jdalton commented Dec 31, 2015

Would this plugin be able to integrate into the rollup or webpack 2 dev setup to enable tree-shaking?

@megawac
Copy link
Contributor

megawac commented Dec 31, 2015

How do you mean @jdalton? Both rollup and webpack have Babel plugins which would allow people to thus use this plugin. (I have not used either to confirm they work.)

https://github.com/rollup/rollup-plugin-babel
https://github.com/babel/babel-loader

@jdalton
Copy link
Member Author

jdalton commented Dec 31, 2015

I have not used either to confirm they work.

That's what I'm asking. I'm not super familiar with babel plugins. It's on my shortlist of things to dig into esp if this gets pulled into the lodash org. I've only seen the output of this plugin generate node require calls but I believe that could be turned into ES6 import syntax as well?

@megawac
Copy link
Contributor

megawac commented Dec 31, 2015

Yeah, it will generate es6 imports if the Babel plugin for modules to commonjs isnt included. The only true requirement imposed is that lodash is imported using es6 syntax

https://www.npmjs.com/package/babel-plugin-transform-es2015-modules-commonjs

@megawac
Copy link
Contributor

megawac commented Dec 31, 2015

Anyway, the one thing to note when using Babel with this plugin and either rollup or webpack is that Babel must be run prior to these bundlers. In the case of rollup (and probably webpack?) es2015-modules-commonjs must be disabled

@jdalton
Copy link
Member Author

jdalton commented Dec 31, 2015

In the case of rollup (and probably webpack?) es2015-modules-commonjs must be disabled

Cool! Would you be able to work up a documentation example for that? If not I can dig into it.

@jdalton
Copy link
Member Author

jdalton commented Jan 6, 2016

Dup of #15.

@jdalton jdalton closed this as completed Jan 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants