From 5ae86cf4ee59dc365cfa47ada77fb0f33c93f2db Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 29 Oct 2023 17:50:33 +0100 Subject: [PATCH] build: use TS for rollup configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- package.json | 2 +- rollup.config.js => rollup.config.ts | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) rename rollup.config.js => rollup.config.ts (94%) 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(), ], }); -- 2.34.1