build: cleanup build env usage
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 20 May 2023 12:33:55 +0000 (14:33 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 20 May 2023 12:33:55 +0000 (14:33 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
package.json
rollup.config.mjs

index d161c7f62fbcc6d6d5c05239838433ac5b06c788..26c2f8a4dc4bb5e1d6aba163f8063fc53739c77d 100644 (file)
@@ -14,7 +14,8 @@
     "preinstall": "npx --yes only-allow pnpm",
     "prepare": "node prepare.js",
     "build": "rollup --config --environment BUILD:development",
-    "build:typedoc": "rollup --config --environment BUILD:development --environment DOCUMENTATION",
+    "build:analyze": "rollup --config --environment ANALYZE,BUILD:development",
+    "build:typedoc": "rollup --config --environment DOCUMENTATION,BUILD:development",
     "build:prod": "rollup --config",
     "benchmark": "pnpm build && node -r source-map-support/register benchmarks/internal/bench.js",
     "benchmark:debug": "pnpm build && node -r source-map-support/register --inspect benchmarks/internal/bench.js",
index 9b9aa8a76fadb59dba51accf10fd2ed7930f8caf..02fc54c00e9f514e30134078d69b56a41a971c29 100644 (file)
@@ -5,8 +5,8 @@ import command from 'rollup-plugin-command'
 import del from 'rollup-plugin-delete'
 
 const isDevelopmentBuild = process.env.BUILD === 'development'
-const isAnalyze = process.env.ANALYZE
-const isDocumentation = process.env.DOCUMENTATION
+const isAnalyzeBuild = process.env.ANALYZE
+const isDocumentationBuild = process.env.DOCUMENTATION
 
 export default {
   input: 'src/index.ts',
@@ -51,7 +51,7 @@ export default {
     del({
       targets: ['lib/*']
     }),
-    isAnalyze && analyze(),
-    isDocumentation && command('pnpm typedoc')
+    isAnalyzeBuild && analyze(),
+    isDocumentationBuild && command('pnpm typedoc')
   ]
 }