I have problem with my webpack/babel configuration. I have installed my component-repository (es6 module without webpack configuration inside) as node_module. And in this s
Many projects that are used as dependencies make sure to compile down to ES5 before an npm publish.
This is useful for a couple reasons.
and it will workOne way to achieve this is to pass the library code through babel before publishing to npm.
When setting up, I took inspiration from the React Bootstrap project. But that was mainly because we wanted to build portable, styled components. However, the way they set up the library for use is pretty nice IMO.
After setting up like this, the consuming applications configuration is very simple, because there is no babel compile to be done. The module bundler (like webpack) can then just bundle the module (as it does for other node_modules dependences).