Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 7838bc4

Browse files
committed
chore: exclude moment locales from build
1 parent 8b0fe33 commit 7838bc4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

webpack.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* global __dirname */
2+
const webpack = require("webpack");
23
const webpackMerge = require("webpack-merge");
34
const singleSpaDefaults = require("webpack-config-single-spa-react");
45
const path = require("path");
@@ -68,5 +69,10 @@ module.exports = (webpackConfigEnv) => {
6869
services: path.resolve(__dirname, "src/services"),
6970
},
7071
},
72+
plugins: [
73+
// ignore moment locales to reduce bundle size by 64kb gzipped
74+
// see solution details https://stackoverflow.com/questions/25384360/how-to-prevent-moment-js-from-loading-locales-with-webpack/25426019#25426019
75+
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
76+
],
7177
});
7278
};

0 commit comments

Comments
 (0)