mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-05-04 21:19:47 +08:00
Ignore Moment.js locales by default (#2187)
* Ignore Moment.js locales by default * Update README.md
This commit is contained in:
@@ -286,6 +286,12 @@ module.exports = {
|
||||
new ManifestPlugin({
|
||||
fileName: 'asset-manifest.json',
|
||||
}),
|
||||
// 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
|
||||
// You can remove this if you don't use Moment.js:
|
||||
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|
||||
],
|
||||
// Some libraries import Node modules but don't use them in the browser.
|
||||
// Tell Webpack to provide empty mocks for them so importing them works.
|
||||
|
||||
Reference in New Issue
Block a user