Migrate to terser

This commit is contained in:
Giuseppe Criscione 2022-10-27 21:07:29 +02:00
parent 295111c754
commit 8bf1aaa5bb
4 changed files with 119 additions and 16 deletions

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
"scripts": {
"build": "npm run build:css && npm run build:js",
"build:css": "sass ./assets/scss/admin.scss:./assets/css/admin.min.css ./assets/scss/admin-dark.scss:./assets/css/admin-dark.min.css --style=compressed --no-source-map",
"build:js": "rollup -c && uglifyjs assets/js/app.min.js -c -m -o assets/js/app.min.js --timings",
"build:js": "rollup -c",
"watch:css": "onchange 'assets/scss/**/*.scss' -- npm run build:css",
"watch:js": "onchange 'assets/js/src/**/*.js' -- npm run build:js",
"lint:css": "stylelint './assets/scss/**/*.scss' --fix",
@ -27,6 +27,7 @@
"devDependencies": {
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^14.1.0",
"@rollup/plugin-terser": "^0.1.0",
"eslint": "^8.26.0",
"onchange": "^7.0.2",
"rollup": "^2.79.0",
@ -35,7 +36,6 @@
"stylelint-config-idiomatic-order": "^9.0.0",
"stylelint-config-standard-scss": "^5.0.0",
"stylelint-order": "^5.0.0",
"stylelint-scss": "^4.3.0",
"uglify-js": "^3.17.2"
"stylelint-scss": "^4.3.0"
}
}

View File

@ -1,5 +1,6 @@
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
export default {
input: 'assets/js/src/main.js',
@ -8,5 +9,5 @@ export default {
format: 'iife',
name: 'Formwork'
},
plugins: [resolve(), commonjs()]
plugins: [resolve(), commonjs(), terser({format: {comments: false}})]
};

View File

@ -105,6 +105,58 @@ __metadata:
languageName: node
linkType: hard
"@jridgewell/gen-mapping@npm:^0.3.0":
version: 0.3.2
resolution: "@jridgewell/gen-mapping@npm:0.3.2"
dependencies:
"@jridgewell/set-array": ^1.0.1
"@jridgewell/sourcemap-codec": ^1.4.10
"@jridgewell/trace-mapping": ^0.3.9
checksum: 1832707a1c476afebe4d0fbbd4b9434fdb51a4c3e009ab1e9938648e21b7a97049fa6009393bdf05cab7504108413441df26d8a3c12193996e65493a4efb6882
languageName: node
linkType: hard
"@jridgewell/resolve-uri@npm:3.1.0":
version: 3.1.0
resolution: "@jridgewell/resolve-uri@npm:3.1.0"
checksum: b5ceaaf9a110fcb2780d1d8f8d4a0bfd216702f31c988d8042e5f8fbe353c55d9b0f55a1733afdc64806f8e79c485d2464680ac48a0d9fcadb9548ee6b81d267
languageName: node
linkType: hard
"@jridgewell/set-array@npm:^1.0.1":
version: 1.1.2
resolution: "@jridgewell/set-array@npm:1.1.2"
checksum: 69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e
languageName: node
linkType: hard
"@jridgewell/source-map@npm:^0.3.2":
version: 0.3.2
resolution: "@jridgewell/source-map@npm:0.3.2"
dependencies:
"@jridgewell/gen-mapping": ^0.3.0
"@jridgewell/trace-mapping": ^0.3.9
checksum: 1b83f0eb944e77b70559a394d5d3b3f98a81fcc186946aceb3ef42d036762b52ef71493c6c0a3b7c1d2f08785f53ba2df1277fe629a06e6109588ff4cdcf7482
languageName: node
linkType: hard
"@jridgewell/sourcemap-codec@npm:1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.10":
version: 1.4.14
resolution: "@jridgewell/sourcemap-codec@npm:1.4.14"
checksum: 61100637b6d173d3ba786a5dff019e1a74b1f394f323c1fee337ff390239f053b87266c7a948777f4b1ee68c01a8ad0ab61e5ff4abb5a012a0b091bec391ab97
languageName: node
linkType: hard
"@jridgewell/trace-mapping@npm:^0.3.9":
version: 0.3.17
resolution: "@jridgewell/trace-mapping@npm:0.3.17"
dependencies:
"@jridgewell/resolve-uri": 3.1.0
"@jridgewell/sourcemap-codec": 1.4.14
checksum: 9d703b859cff5cd83b7308fd457a431387db5db96bd781a63bf48e183418dd9d3d44e76b9e4ae13237f6abeeb25d739ec9215c1d5bfdd08f66f750a50074a339
languageName: node
linkType: hard
"@nodelib/fs.scandir@npm:2.1.5":
version: 2.1.5
resolution: "@nodelib/fs.scandir@npm:2.1.5"
@ -185,6 +237,20 @@ __metadata:
languageName: node
linkType: hard
"@rollup/plugin-terser@npm:^0.1.0":
version: 0.1.0
resolution: "@rollup/plugin-terser@npm:0.1.0"
dependencies:
terser: ^5.15.1
peerDependencies:
rollup: ^2.x || ^3.x
peerDependenciesMeta:
rollup:
optional: true
checksum: 53d86ff78121e77c9200c84d021b1a16f8974aff9738cd7ec845ad540f267427d7753f688d2aa70cfc8f6011d5c93cda6d744e5b1c427a7afa5a630d88c15418
languageName: node
linkType: hard
"@rollup/pluginutils@npm:^3.1.0":
version: 3.1.0
resolution: "@rollup/pluginutils@npm:3.1.0"
@ -272,7 +338,7 @@ __metadata:
languageName: node
linkType: hard
"acorn@npm:^8.8.0":
"acorn@npm:^8.5.0, acorn@npm:^8.8.0":
version: 8.8.1
resolution: "acorn@npm:8.8.1"
bin:
@ -471,6 +537,13 @@ __metadata:
languageName: node
linkType: hard
"buffer-from@npm:^1.0.0":
version: 1.1.2
resolution: "buffer-from@npm:1.1.2"
checksum: 0448524a562b37d4d7ed9efd91685a5b77a50672c556ea254ac9a6d30e3403a517d8981f10e565db24e8339413b43c97ca2951f10e399c6125a0d8911f5679bb
languageName: node
linkType: hard
"builtin-modules@npm:^3.3.0":
version: 3.3.0
resolution: "builtin-modules@npm:3.3.0"
@ -645,6 +718,13 @@ __metadata:
languageName: node
linkType: hard
"commander@npm:^2.20.0":
version: 2.20.3
resolution: "commander@npm:2.20.3"
checksum: ab8c07884e42c3a8dbc5dd9592c606176c7eb5c1ca5ff274bcf907039b2c41de3626f684ea75ccf4d361ba004bbaff1f577d5384c155f3871e456bdf27becf9e
languageName: node
linkType: hard
"commondir@npm:^1.0.1":
version: 1.0.1
resolution: "commondir@npm:1.0.1"
@ -1086,6 +1166,7 @@ __metadata:
dependencies:
"@rollup/plugin-commonjs": ^22.0.2
"@rollup/plugin-node-resolve": ^14.1.0
"@rollup/plugin-terser": ^0.1.0
chartist: ^0.11.4
codemirror: ^5.65.2
eslint: ^8.26.0
@ -1098,7 +1179,6 @@ __metadata:
stylelint-config-standard-scss: ^5.0.0
stylelint-order: ^5.0.0
stylelint-scss: ^4.3.0
uglify-js: ^3.17.2
languageName: unknown
linkType: soft
@ -2597,6 +2677,23 @@ __metadata:
languageName: node
linkType: hard
"source-map-support@npm:~0.5.20":
version: 0.5.21
resolution: "source-map-support@npm:0.5.21"
dependencies:
buffer-from: ^1.0.0
source-map: ^0.6.0
checksum: 43e98d700d79af1d36f859bdb7318e601dfc918c7ba2e98456118ebc4c4872b327773e5a1df09b0524e9e5063bb18f0934538eace60cca2710d1fa687645d137
languageName: node
linkType: hard
"source-map@npm:^0.6.0":
version: 0.6.1
resolution: "source-map@npm:0.6.1"
checksum: 59ce8640cf3f3124f64ac289012c2b8bd377c238e316fb323ea22fbfe83da07d81e000071d7242cad7a23cd91c7de98e4df8830ec3f133cb6133a5f6e9f67bc2
languageName: node
linkType: hard
"sourcemap-codec@npm:^1.4.8":
version: 1.4.8
resolution: "sourcemap-codec@npm:1.4.8"
@ -2899,6 +2996,20 @@ __metadata:
languageName: node
linkType: hard
"terser@npm:^5.15.1":
version: 5.15.1
resolution: "terser@npm:5.15.1"
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: 9880a1e0956983a1ce5de204ea35121c0009fa41d582a6904ae850e1953a1a2cc021168439565280c5a8eee67c85a874175627e24989b046c7a72589b81c3979
languageName: node
linkType: hard
"text-table@npm:^0.2.0":
version: 0.2.0
resolution: "text-table@npm:0.2.0"
@ -2968,15 +3079,6 @@ __metadata:
languageName: node
linkType: hard
"uglify-js@npm:^3.17.2":
version: 3.17.4
resolution: "uglify-js@npm:3.17.4"
bin:
uglifyjs: bin/uglifyjs
checksum: 7b3897df38b6fc7d7d9f4dcd658599d81aa2b1fb0d074829dd4e5290f7318dbca1f4af2f45acb833b95b1fe0ed4698662ab61b87e94328eb4c0a0d3435baf924
languageName: node
linkType: hard
"unique-filename@npm:^2.0.0":
version: 2.0.1
resolution: "unique-filename@npm:2.0.1"