Chunk out jslib and large modules to separate caches (#2331)

* Chunk out jslib and large modules to separate caches

* It's sufficient to just extract maps from the source

(cherry picked from commit f4bf8b2e1d)
This commit is contained in:
Matt Gibson 2022-02-10 18:05:09 -06:00
parent ee68d01cac
commit bf9fd2dee8
1 changed files with 2 additions and 5 deletions

View File

@ -83,9 +83,6 @@ const plugins = [
{ from: "./src/content/autofill.css", to: "content" }, { from: "./src/content/autofill.css", to: "content" },
], ],
}), }),
new webpack.SourceMapDevToolPlugin({
include: ["popup/main.js", "background.js"],
}),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: "[name].css", filename: "[name].css",
chunkFilename: "chunk-[id].css", chunkFilename: "chunk-[id].css",
@ -110,7 +107,7 @@ const plugins = [
const config = { const config = {
mode: ENV, mode: ENV,
devtool: false, devtool: ENV === "development" ? "eval-source-map" : "source-map",
entry: { entry: {
"popup/polyfills": "./src/popup/polyfills.ts", "popup/polyfills": "./src/popup/polyfills.ts",
"popup/main": "./src/popup/main.ts", "popup/main": "./src/popup/main.ts",
@ -124,7 +121,7 @@ const config = {
"notification/bar": "./src/notification/bar.js", "notification/bar": "./src/notification/bar.js",
}, },
optimization: { optimization: {
minimize: false, minimize: true,
splitChunks: { splitChunks: {
cacheGroups: { cacheGroups: {
commons: { commons: {