Next.js should ignore all moment locales and request the user opt-into the feature, until it becomes a default at some point in the future.
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
// solution that requires the user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
Maybe it's worth tuning Lodash with babel-plugin-transform-imports or something similar?
This looks like a breaking change 馃
That's why the behavior is opt-in @kachkaev!
I thought the ignore plugin would be just injected and that's it. If it's behind a option, no Next.js projects will be harmed after a minor version bump :)
This was landed in #8345
Most helpful comment
That's why the behavior is opt-in @kachkaev!