1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-18503] Webpack caching, minimize only on prod for Web (#13508)

* PM-18503: Webpack caching, minimize only on prod for Web

* caching not picking up dependencies changes

* caching disabled in production
This commit is contained in:
Maciej Zieniuk
2025-03-11 18:20:32 +01:00
committed by GitHub
parent c4e87d3f90
commit 18ad710909

View File

@@ -81,6 +81,7 @@ const moduleRules = [
loader: "babel-loader",
options: {
configFile: "../../babel.config.json",
cacheDirectory: NODE_ENV !== "production",
},
},
],
@@ -349,6 +350,20 @@ const webpackConfig = {
styles: ["./src/scss/styles.scss", "./src/scss/tailwind.css"],
theme_head: "./src/theme.ts",
},
cache:
NODE_ENV === "production"
? false
: {
type: "filesystem",
allowCollectingMemory: true,
cacheDirectory: path.resolve(__dirname, "../../node_modules/.cache/webpack"),
buildDependencies: {
config: [__filename],
},
},
snapshot: {
unmanagedPaths: [path.resolve(__dirname, "../../node_modules/@bitwarden/")],
},
optimization: {
splitChunks: {
cacheGroups: {
@@ -361,6 +376,7 @@ const webpackConfig = {
},
},
},
minimize: NODE_ENV === "production",
minimizer: [
new TerserPlugin({
terserOptions: {