-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Closed
Labels
WebpackRelated to Webpack with Next.js.Related to Webpack with Next.js.
Milestone
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"
]
}
philcockfield, rauchg, slorber, mattecapu, orlin and 360 morekenberkeley, JithinKS97, benwinding, eddyw, andredezzy and 7 morephilcockfield, slorber, thealjey, ek, saibs and 41 morephilcockfield, slorber, CrlsMrls, thealjey, ek and 58 morekenberkeley, JithinKS97, francisrod01, InsOpDe, eddyw and 11 morekenberkeley, LRNZ09, francisrod01, wis, eddyw and 9 more
Metadata
Metadata
Assignees
Labels
WebpackRelated to Webpack with Next.js.Related to Webpack with Next.js.