And fix GitHub CI.
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
node-version: ${{ matrix.node-version }}
- name: npm install
run: npm ci
- - name: npm run build:prod
- run: npm run build:prod
+ - name: npm run build
+ run: npm run build
{
"type": "pwa-node",
"request": "launch",
- "name": "Debug Program via npm",
+ "name": "Debug Simulator via npm",
"cwd": "${workspaceFolder}",
"preLaunchTask": "Build",
"runtimeExecutable": "npm",
"<node_internals>/**"
],
"stopOnEntry": true
+ },
+ {
+ "type": "pwa-node",
+ "request": "launch",
+ "name": "Debug Simulator Development Build via npm",
+ "cwd": "${workspaceFolder}",
+ "runtimeExecutable": "npm",
+ "runtimeArgs": [
+ "run-script",
+ "start:dev:debug"
+ ],
+ "skipFiles": [
+ "<node_internals>/**"
+ ],
+ "stopOnEntry": true
}
]
}
"label": "Build",
"type": "npm",
"script": "build"
+ },
+ {
+ "label": "Development Build",
+ "type": "npm",
+ "script": "build:dev"
}
]
}
- builder: custom
commands:
- npm install
- - npm run build:prod
+ - npm run build
resources:
- name: dynatrace-service
"dev": true
},
"@types/node": {
- "version": "14.14.27",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.27.tgz",
- "integrity": "sha512-Ecfmo4YDQPwuqTCl1yBxLV5ihKfRlkBmzUEDcfIRvDxOTGQEeikr317Ln7Gcv0tjA8dVgKI3rniqW2G1OyKDng==",
+ "version": "14.14.28",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.28.tgz",
+ "integrity": "sha512-lg55ArB+ZiHHbBBttLpzD07akz0QPrZgUODNakeC09i62dnrywr9mFErHuaPlB6I7z+sEbK+IYmplahvplCj2g==",
"dev": true
},
"@types/offscreencanvas": {
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
"dev": true
},
+ "jest-worker": {
+ "version": "26.6.2",
+ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz",
+ "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==",
+ "dev": true,
+ "requires": {
+ "@types/node": "*",
+ "merge-stream": "^2.0.0",
+ "supports-color": "^7.0.0"
+ },
+ "dependencies": {
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ }
+ }
+ },
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"source-map": "^0.5.6"
}
},
+ "merge-stream": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
+ "dev": true
+ },
"merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
"del": "^5.1.0"
}
},
+ "rollup-plugin-terser": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz",
+ "integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.10.4",
+ "jest-worker": "^26.2.1",
+ "serialize-javascript": "^4.0.0",
+ "terser": "^5.0.0"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.7.3",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
+ "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
+ "dev": true
+ },
+ "terser": {
+ "version": "5.6.0",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.6.0.tgz",
+ "integrity": "sha512-vyqLMoqadC1uR0vywqOZzriDYzgEkNJFK4q9GeyOBHIbiECHiWLKcWfbQWAUaPfxkjDhapSlZB9f7fkMrvkVjA==",
+ "dev": true,
+ "requires": {
+ "commander": "^2.20.0",
+ "source-map": "~0.7.2",
+ "source-map-support": "~0.5.19"
+ }
+ }
+ }
+ },
"rollup-plugin-typescript2": {
"version": "0.29.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.29.0.tgz",
"semver": "^5.0.3"
}
},
+ "serialize-javascript": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz",
+ "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==",
+ "dev": true,
+ "requires": {
+ "randombytes": "^2.1.0"
+ }
+ },
"set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"prestart": "npm run build",
"start": "cross-env NODE_ENV=production node -r source-map-support/register dist/start.js",
"start:debug": "cross-env NODE_ENV=production node -r source-map-support/register --inspect dist/start.js",
+ "start:dev": "npm run build:dev && cross-env NODE_ENV=development node -r source-map-support/register dist/start.js",
+ "start:dev:debug": "npm run build:dev && cross-env NODE_ENV=development node -r source-map-support/register --inspect dist/start.js",
"start:prof": "cross-env NODE_ENV=production node -r source-map-support/register --prof dist/start.js",
"start:doctorprof": "cross-env NODE_ENV=production clinic doctor -- node -r source-map-support/register dist/start.js",
"start:flameprof": "cross-env NODE_ENV=production clinic flame -- node -r source-map-support/register dist/start.js",
"utf-8-validate": "^5.0.4"
},
"devDependencies": {
- "@types/node": "^14.14.27",
+ "@types/node": "^14.14.28",
"@types/uuid": "^8.3.0",
"@types/ws": "^7.4.0",
"@typescript-eslint/eslint-plugin": "^4.15.0",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-delete": "^2.0.0",
+ "rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0",
"typescript": "^4.1.5"
}
import analyze from 'rollup-plugin-analyzer';
import copy from 'rollup-plugin-copy';
import del from 'rollup-plugin-delete';
+import { terser } from 'rollup-plugin-terser';
import typescript from 'rollup-plugin-typescript2';
const isDevelopmentBuild = process.env.BUILD === 'development';
export default {
input: ['src/start.ts', 'src/charging-station/StationWorker.ts'],
- output: {
+ output:
+ {
dir: 'dist',
format: 'cjs',
exports: 'auto',
sourcemap: true,
preserveModules: true,
- preserveModulesRoot: 'src'
+ preserveModulesRoot: 'src',
+ ...!isDevelopmentBuild && { plugins: [terser({ numWorkers: 2 })] }
},
external: ['crypto', 'perf_hooks', 'fs', 'path', 'poolifier', 'uuid', 'ws', 'winston-daily-rotate-file', 'winston/lib/winston/transports', 'winston', 'worker_threads'],
plugins: [