build: use TS for rollup configuration
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 29 Oct 2023 16:50:33 +0000 (17:50 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 29 Oct 2023 16:50:33 +0000 (17:50 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
package.json
rollup.config.ts [moved from rollup.config.js with 94% similarity]

index 1b79e6dcb4f8012823a3e880b5db144e492ce486..93642217dd8bd595804d631e7bd5e09f26071103 100644 (file)
@@ -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",
similarity index 94%
rename from rollup.config.js
rename to rollup.config.ts
index ec98513a8e889a0f0baef91cd24f6484360ab675..5e1fb4dc0a7d259f45116cc28730c7ad032f1c2b 100644 (file)
@@ -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(),
   ],
 });