Skip to content

Commit

Permalink
chore(webpack): disable devtool for production builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Thuan Vo committed May 31, 2023
1 parent 500204c commit 7c51de4
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"rxjs": "^7.8.0",
"style-loader": "^3.3.1",
"svg-url-loader": "^8.0.0",
"terser-webpack-plugin": "^5.3.3",
"terser-webpack-plugin": "^5.3.9",
"ts-jest": "^27.0.5",
"ts-loader": "^9.4.2",
"tsconfig-paths-webpack-plugin": "^4.0.0",
Expand Down
12 changes: 10 additions & 2 deletions webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@ const { EnvironmentPlugin } = require('webpack');

module.exports = merge(common('production'), {
mode: 'production',
devtool: 'eval-source-map',
devtool: false,
cache: {
type: 'filesystem',
compression: 'gzip',
cacheDirectory: path.resolve(__dirname, '.build_cache'),
},
optimization: {
minimize: true,
minimizer: [
new TerserJSPlugin({}),
new TerserJSPlugin({
terserOptions: {
format: {
comments: false,
},
},
extractComments: false,
}),
new CssMinimizerPlugin({
minimizerOptions: {
preset: ['default', { mergeLonghand: false }]
Expand Down
52 changes: 49 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,16 @@ __metadata:
languageName: node
linkType: hard

"@jridgewell/trace-mapping@npm:^0.3.17":
version: 0.3.18
resolution: "@jridgewell/trace-mapping@npm:0.3.18"
dependencies:
"@jridgewell/resolve-uri": 3.1.0
"@jridgewell/sourcemap-codec": 1.4.14
checksum: 0572669f855260808c16fe8f78f5f1b4356463b11d3f2c7c0b5580c8ba1cbf4ae53efe9f627595830856e57dbac2325ac17eb0c3dd0ec42102e6f227cc289c02
languageName: node
linkType: hard

"@leichtgewicht/ip-codec@npm:^2.0.1":
version: 2.0.4
resolution: "@leichtgewicht/ip-codec@npm:2.0.4"
Expand Down Expand Up @@ -3991,7 +4001,7 @@ __metadata:
showdown: ^2.1.0
style-loader: ^3.3.1
svg-url-loader: ^8.0.0
terser-webpack-plugin: ^5.3.3
terser-webpack-plugin: ^5.3.9
ts-jest: ^27.0.5
ts-loader: ^9.4.2
tsconfig-paths-webpack-plugin: ^4.0.0
Expand Down Expand Up @@ -11844,7 +11854,7 @@ __metadata:
languageName: node
linkType: hard

"serialize-javascript@npm:^6.0.0":
"serialize-javascript@npm:^6.0.0, serialize-javascript@npm:^6.0.1":
version: 6.0.1
resolution: "serialize-javascript@npm:6.0.1"
dependencies:
Expand Down Expand Up @@ -12615,7 +12625,7 @@ __metadata:
languageName: node
linkType: hard

"terser-webpack-plugin@npm:^5.1.3, terser-webpack-plugin@npm:^5.3.3":
"terser-webpack-plugin@npm:^5.1.3":
version: 5.3.6
resolution: "terser-webpack-plugin@npm:5.3.6"
dependencies:
Expand All @@ -12637,6 +12647,28 @@ __metadata:
languageName: node
linkType: hard

"terser-webpack-plugin@npm:^5.3.9":
version: 5.3.9
resolution: "terser-webpack-plugin@npm:5.3.9"
dependencies:
"@jridgewell/trace-mapping": ^0.3.17
jest-worker: ^27.4.5
schema-utils: ^3.1.1
serialize-javascript: ^6.0.1
terser: ^5.16.8
peerDependencies:
webpack: ^5.1.0
peerDependenciesMeta:
"@swc/core":
optional: true
esbuild:
optional: true
uglify-js:
optional: true
checksum: 41705713d6f9cb83287936b21e27c658891c78c4392159f5148b5623f0e8c48559869779619b058382a4c9758e7820ea034695e57dc7c474b4962b79f553bc5f
languageName: node
linkType: hard

"terser@npm:^5.10.0, terser@npm:^5.14.1":
version: 5.16.3
resolution: "terser@npm:5.16.3"
Expand All @@ -12651,6 +12683,20 @@ __metadata:
languageName: node
linkType: hard

"terser@npm:^5.16.8":
version: 5.17.6
resolution: "terser@npm:5.17.6"
dependencies:
"@jridgewell/source-map": ^0.3.2
acorn: ^8.5.0
commander: ^2.20.0
source-map-support: ~0.5.20
bin:
terser: bin/terser
checksum: 9c0ab0261a99a61c5f53d05d4ecc7f68c552bae6af481464fdd596bc9d7e89ce8e21b1833cb3ce06ad5f658e2b226081d543e4fe6e324b2cdf03ee8b7eeec01a
languageName: node
linkType: hard

"test-exclude@npm:^6.0.0":
version: 6.0.0
resolution: "test-exclude@npm:6.0.0"
Expand Down

0 comments on commit 7c51de4

Please sign in to comment.