From: Jérôme Benoit Date: Sun, 29 Oct 2023 16:50:33 +0000 (+0100) Subject: build: use TS for rollup configuration X-Git-Tag: v1.2.24~68 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5ae86cf4ee59dc365cfa47ada77fb0f33c93f2db;p=e-mobility-charging-stations-simulator.git build: use TS for rollup configuration Signed-off-by: Jérôme Benoit --- diff --git a/package.json b/package.json index 1b79e6dc..93642217 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "start:flameprof": "cross-env NODE_ENV=production clinic flame -- node -r source-map-support/register dist/start.js", "start:bubbleprof": "cross-env NODE_ENV=production clinic bubbleprof -- node -r source-map-support/register dist/start.js", "start:heapprofiler": "cross-env NODE_ENV=production clinic heapprofiler -- node -r source-map-support/register dist/start.js", - "rollup": "pnpm build-requirements && rollup --config", + "rollup": "pnpm build-requirements && rollup --config --configPlugin typescript", "build": "pnpm rollup", "build:cf": "pnpm clean:node_modules && npx cross-env SKIP_PREINSTALL=1 npm install && pnpm rollup", "build:dev": "pnpm rollup --environment BUILD:development", diff --git a/rollup.config.js b/rollup.config.ts similarity index 94% rename from rollup.config.js rename to rollup.config.ts index ec98513a..5e1fb4dc 100644 --- a/rollup.config.js +++ b/rollup.config.ts @@ -1,4 +1,3 @@ -/* eslint-disable n/no-unpublished-import */ import * as os from 'node:os'; import { env } from 'node:process'; @@ -10,8 +9,8 @@ import { defineConfig } from 'rollup'; import analyze from 'rollup-plugin-analyzer'; import del from 'rollup-plugin-delete'; -const availableParallelism = () => { - // eslint-disable-next-line no-shadow +const availableParallelism = (): number => { + // eslint-disable-next-line @typescript-eslint/no-shadow let availableParallelism = 1; try { availableParallelism = os.availableParallelism(); @@ -102,6 +101,6 @@ export default defineConfig({ 'assets/ui-protocol/**/*', ], }), - isAnalyzeBuild && analyze(), + Boolean(isAnalyzeBuild) && analyze(), ], });