Merge branch 'minification' into 'master'

ci: use minification for production builds

See merge request dungeonslayers/ds4!153
This commit is contained in:
Johannes Loher 2021-10-26 21:01:52 +00:00
commit 0d54cfcff2
4 changed files with 135 additions and 3 deletions

View file

@ -51,6 +51,7 @@ build:
stage: build
before_script:
- yarn install --immutable
- if [[ ! -z ${CI_COMMIT_TAG+x} ]]; then export NODE_ENV=production; fi
script:
- yarn build
- mv dist ds4

View file

@ -78,6 +78,8 @@
"lint-staged": "11.2.6",
"prettier": "2.4.1",
"rollup": "2.58.3",
"rollup-plugin-sourcemaps": "^0.6.3",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "0.30.0",
"sass": "1.43.3",
"semver": "7.3.5",

View file

@ -3,6 +3,8 @@
// SPDX-License-Identifier: MIT
const typescript = require("rollup-plugin-typescript2");
const sourcemaps = require("rollup-plugin-sourcemaps");
const { terser } = require("rollup-plugin-terser");
module.exports = {
input: "src/module/ds4.ts",
@ -11,5 +13,5 @@ module.exports = {
format: "es",
sourcemap: true,
},
plugins: [typescript({})],
plugins: [sourcemaps(), typescript({}), process.env.NODE_ENV === "production" && terser()],
};

131
yarn.lock
View file

@ -14,6 +14,15 @@ __metadata:
languageName: node
linkType: hard
"@babel/code-frame@npm:^7.10.4":
version: 7.15.8
resolution: "@babel/code-frame@npm:7.15.8"
dependencies:
"@babel/highlight": ^7.14.5
checksum: d75950f0e0925b33ab5e870079134509c13bcdbf96c8bf4d0dea91606775bc044258c762104ab20882fda3b07cbff24176ed77dfb57af5a901bde33ddfe690bb
languageName: node
linkType: hard
"@babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.14.5":
version: 7.14.5
resolution: "@babel/code-frame@npm:7.14.5"
@ -1316,6 +1325,19 @@ __metadata:
languageName: node
linkType: hard
"@rollup/pluginutils@npm:^3.0.9":
version: 3.1.0
resolution: "@rollup/pluginutils@npm:3.1.0"
dependencies:
"@types/estree": 0.0.39
estree-walker: ^1.0.1
picomatch: ^2.2.2
peerDependencies:
rollup: ^1.20.0||^2.0.0
checksum: 8be16e27863c219edbb25a4e6ec2fe0e1e451d9e917b6a43cf2ae5bc025a6b8faaa40f82a6e53b66d0de37b58ff472c6c3d57a83037ae635041f8df959d6d9aa
languageName: node
linkType: hard
"@rollup/pluginutils@npm:^4.1.0":
version: 4.1.0
resolution: "@rollup/pluginutils@npm:4.1.0"
@ -1419,6 +1441,13 @@ __metadata:
languageName: node
linkType: hard
"@types/estree@npm:0.0.39":
version: 0.0.39
resolution: "@types/estree@npm:0.0.39"
checksum: 412fb5b9868f2c418126451821833414189b75cc6bf84361156feed733e3d92ec220b9d74a89e52722e03d5e241b2932732711b7497374a404fad49087adc248
languageName: node
linkType: hard
"@types/fs-extra@npm:9.0.13":
version: 9.0.13
resolution: "@types/fs-extra@npm:9.0.13"
@ -2845,6 +2874,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
"commander@npm:^8.2.0":
version: 8.2.0
resolution: "commander@npm:8.2.0"
@ -3481,6 +3517,8 @@ __metadata:
lint-staged: 11.2.6
prettier: 2.4.1
rollup: 2.58.3
rollup-plugin-sourcemaps: ^0.6.3
rollup-plugin-terser: ^7.0.2
rollup-plugin-typescript2: 0.30.0
sass: 1.43.3
semver: 7.3.5
@ -3902,6 +3940,13 @@ __metadata:
languageName: node
linkType: hard
"estree-walker@npm:^1.0.1":
version: 1.0.1
resolution: "estree-walker@npm:1.0.1"
checksum: 7e70da539691f6db03a08e7ce94f394ce2eef4180e136d251af299d41f92fb2d28ebcd9a6e393e3728d7970aeb5358705ddf7209d52fbcb2dd4693f95dcf925f
languageName: node
linkType: hard
"estree-walker@npm:^2.0.1":
version: 2.0.2
resolution: "estree-walker@npm:2.0.2"
@ -6050,6 +6095,17 @@ fsevents@^1.2.7:
languageName: node
linkType: hard
"jest-worker@npm:^26.2.1":
version: 26.6.2
resolution: "jest-worker@npm:26.6.2"
dependencies:
"@types/node": "*"
merge-stream: ^2.0.0
supports-color: ^7.0.0
checksum: f9afa3b88e3f12027901e4964ba3ff048285b5783b5225cab28fac25b4058cea8ad54001e9a1577ee2bed125fac3ccf5c80dc507b120300cc1bbcb368796533e
languageName: node
linkType: hard
"jest-worker@npm:^27.3.1":
version: 27.3.1
resolution: "jest-worker@npm:27.3.1"
@ -7803,6 +7859,15 @@ fsevents@^1.2.7:
languageName: node
linkType: hard
"randombytes@npm:^2.1.0":
version: 2.1.0
resolution: "randombytes@npm:2.1.0"
dependencies:
safe-buffer: ^5.1.0
checksum: d779499376bd4cbb435ef3ab9a957006c8682f343f14089ed5f27764e4645114196e75b7f6abf1cbd84fd247c0cb0651698444df8c9bf30e62120fbbc52269d6
languageName: node
linkType: hard
"react-is@npm:^17.0.1":
version: 17.0.2
resolution: "react-is@npm:17.0.2"
@ -8175,6 +8240,36 @@ fsevents@^1.2.7:
languageName: node
linkType: hard
"rollup-plugin-sourcemaps@npm:^0.6.3":
version: 0.6.3
resolution: "rollup-plugin-sourcemaps@npm:0.6.3"
dependencies:
"@rollup/pluginutils": ^3.0.9
source-map-resolve: ^0.6.0
peerDependencies:
"@types/node": ">=10.0.0"
rollup: ">=0.31.2"
peerDependenciesMeta:
"@types/node":
optional: true
checksum: bb4909a90f2e824717a67ad146b2cccc40411ee54709ffa548c47c4dfe485bd55039a5850d7640ecb2691de9dc30e3fd57287e4d74331f36fed9c263d86dd4dc
languageName: node
linkType: hard
"rollup-plugin-terser@npm:^7.0.2":
version: 7.0.2
resolution: "rollup-plugin-terser@npm:7.0.2"
dependencies:
"@babel/code-frame": ^7.10.4
jest-worker: ^26.2.1
serialize-javascript: ^4.0.0
terser: ^5.0.0
peerDependencies:
rollup: ^2.0.0
checksum: af84bb7a7a894cd00852b6486528dfb8653cf94df4c126f95f389a346f401d054b08c46bee519a2ab6a22b33804d1d6ac6d8c90b1b2bf8fffb097eed73fc3c72
languageName: node
linkType: hard
"rollup-plugin-typescript2@npm:0.30.0":
version: 0.30.0
resolution: "rollup-plugin-typescript2@npm:0.30.0"
@ -8318,6 +8413,15 @@ fsevents@^1.2.7:
languageName: node
linkType: hard
"serialize-javascript@npm:^4.0.0":
version: 4.0.0
resolution: "serialize-javascript@npm:4.0.0"
dependencies:
randombytes: ^2.1.0
checksum: 3273b3394b951671fcf388726e9577021870dfbf85e742a1183fb2e91273e6101bdccea81ff230724f6659a7ee4cef924b0ff9baca32b79d9384ec37caf07302
languageName: node
linkType: hard
"set-blocking@npm:^2.0.0, set-blocking@npm:~2.0.0":
version: 2.0.0
resolution: "set-blocking@npm:2.0.0"
@ -8499,7 +8603,17 @@ fsevents@^1.2.7:
languageName: node
linkType: hard
"source-map-support@npm:^0.5.17":
"source-map-resolve@npm:^0.6.0":
version: 0.6.0
resolution: "source-map-resolve@npm:0.6.0"
dependencies:
atob: ^2.1.2
decode-uri-component: ^0.2.0
checksum: fe503b9e5dac1c54be835282fcfec10879434e7b3ee08a9774f230299c724a8d403484d9531276d1670c87390e0e4d1d3f92b14cca6e4a2445ea3016b786ecd4
languageName: node
linkType: hard
"source-map-support@npm:^0.5.17, source-map-support@npm:~0.5.20":
version: 0.5.20
resolution: "source-map-support@npm:0.5.20"
dependencies:
@ -8540,7 +8654,7 @@ fsevents@^1.2.7:
languageName: node
linkType: hard
"source-map@npm:^0.7.3":
"source-map@npm:^0.7.3, source-map@npm:~0.7.2":
version: 0.7.3
resolution: "source-map@npm:0.7.3"
checksum: cd24efb3b8fa69b64bf28e3c1b1a500de77e84260c5b7f2b873f88284df17974157cc88d386ee9b6d081f08fdd8242f3fc05c953685a6ad81aad94c7393dedea
@ -8926,6 +9040,19 @@ fsevents@^1.2.7:
languageName: node
linkType: hard
"terser@npm:^5.0.0":
version: 5.9.0
resolution: "terser@npm:5.9.0"
dependencies:
commander: ^2.20.0
source-map: ~0.7.2
source-map-support: ~0.5.20
bin:
terser: bin/terser
checksum: 11c1246b1991015a8881742878af779e3863fad42f626ffda957dbf28c94bf51e7994cffb9ffbec86ff3c23ab45ffa6d79d453c15e664306e35fc7b2c4eee5f4
languageName: node
linkType: hard
"test-exclude@npm:^6.0.0":
version: 6.0.0
resolution: "test-exclude@npm:6.0.0"