Closed
Description
Now some of us ships NPM packages (specially components) written in ES2015 without transpiling them.
That's a pretty good thing specially if they are gonna used in a project like Next.js or CRA (which does transpiling). They offer benefits like:
- No need to transpile before shipping to NPM
- Get the benefit of Webpack 2's tree-shaking
But we can't do this now we exclude everything inside node_modules from babel transpiling.
So, here's the proposed solution.
We have an entry in next.config.js
to include modules which needs to go through babel. See:
module.exports = {
transpileModules: [
"my-component",
"redux/src"
]
}