Update webpack config to remove bundle comment extraction

This commit is contained in:
Dale Davies
2022-03-16 14:42:58 +00:00
parent 565f152466
commit ad722100cc
5 changed files with 25 additions and 19 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +0,0 @@
/**
* Calculate the time, local to the requested location from
* the OpenWeather API, by passing in the number of seconds
* that location has shifted from UTC based on the timezones.
*
* @author Dale Davies <dale@daledavies.co.uk>
* @license MIT
*/

19
package-lock.json generated
View File

@@ -43,9 +43,9 @@
"dev": true
},
"@types/node": {
"version": "17.0.15",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.15.tgz",
"integrity": "sha512-zWt4SDDv1S9WRBNxLFxFRHxdD9tvH8f5/kg5/IaLFdnSNXsDY4eL3Q3XXN+VxUnWIhyVFDwcsmAprvwXoM/ClA==",
"version": "17.0.21",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.21.tgz",
"integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==",
"dev": true
},
"@webassemblyjs/ast": {
@@ -543,9 +543,9 @@
"dev": true
},
"jest-worker": {
"version": "27.5.0",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.0.tgz",
"integrity": "sha512-8OEHiPNOPTfaWnJ2SUHM8fmgeGq37uuGsQBvGKQJl1f+6WIy6g7G3fE2ruI5294bUKUI9FaCWt5hDvO8HSwsSg==",
"version": "27.5.1",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz",
"integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==",
"dev": true,
"requires": {
"@types/node": "*",
@@ -850,11 +850,12 @@
"dev": true
},
"terser": {
"version": "5.10.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz",
"integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==",
"version": "5.12.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.12.1.tgz",
"integrity": "sha512-NXbs+7nisos5E+yXwAD+y7zrcTkMqb0dEJxIGtSKPdCBzopf7ni4odPul2aechpV7EXNvOudYOX2bb5tln1jbQ==",
"dev": true,
"requires": {
"acorn": "^8.5.0",
"commander": "^2.20.0",
"source-map": "~0.7.2",
"source-map-support": "~0.5.20"

View File

@@ -7,6 +7,7 @@
"build": "webpack"
},
"devDependencies": {
"terser-webpack-plugin": "^5.3.1",
"webpack": "^5.68.0",
"webpack-cli": "^4.9.2"
},

View File

@@ -1,4 +1,5 @@
const path = require('path');
const Terser = require('terser-webpack-plugin');
module.exports = {
mode: 'production',
@@ -7,4 +8,16 @@ module.exports = {
filename: 'index.bundle.js',
path: path.resolve(__dirname, './jumpapp/assets/js/'),
},
};
optimization: {
minimizer: [
new Terser({
terserOptions: {
format: {
comments: false,
},
},
extractComments: false,
}),
],
},
};