build: use regex for external in rollup config
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 5 Nov 2023 11:56:06 +0000 (12:56 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 5 Nov 2023 11:56:06 +0000 (12:56 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
examples/typescript/http-server-pool/express-cluster/rollup.config.ts
examples/typescript/http-server-pool/express-hybrid/rollup.config.ts
examples/typescript/http-server-pool/fastify-cluster/rollup.config.ts
examples/typescript/http-server-pool/fastify-hybrid/rollup.config.ts
examples/typescript/websocket-server-pool/ws-cluster/rollup.config.ts
examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.ts
rollup.config.mjs

index ac0da32629d1749be0c2b6c0be31df7a4f791506..1ce8d77b96b80214ac78100648a10731e37061a7 100644 (file)
@@ -19,7 +19,7 @@ export default defineConfig({
       sourcemap: true
     }
   ],
-  external: ['express', 'node:path', 'node:url', 'poolifier'],
+  external: ['express', /node:*/, 'poolifier'],
   plugins: [
     typescript(),
     del({
index 9337c5807d9b2e8d4e7a99889f681c6dc5f93938..50b6abd61aadc23b2229599ae836099dccee4a37 100644 (file)
@@ -23,7 +23,7 @@ export default defineConfig({
       sourcemap: true
     }
   ],
-  external: ['express', 'node:path', 'node:url', 'poolifier'],
+  external: ['express', /node:*/, 'poolifier'],
   plugins: [
     typescript(),
     del({
index ee04284f1674d1c578cffc1233d64489ee346d3f..50653c74f296b972b7b017602ef77f427ccbe23a 100644 (file)
@@ -19,7 +19,7 @@ export default defineConfig({
       sourcemap: true
     }
   ],
-  external: ['fastify', 'node:path', 'node:url', 'poolifier'],
+  external: ['fastify', /node:*/, 'poolifier'],
   plugins: [
     typescript(),
     del({
index 293d69fc289db45a0b282478ba44de0c3e21216c..4b3e4e63d058bf2136048b1baa1e02e19d331342 100644 (file)
@@ -23,7 +23,7 @@ export default defineConfig({
       sourcemap: true
     }
   ],
-  external: ['fastify', 'fastify-plugin', 'node:path', 'node:url', 'poolifier'],
+  external: ['fastify', 'fastify-plugin', /node:*/, 'poolifier'],
   plugins: [
     typescript(),
     del({
index ff47feedeb349e94de8242b2997277a3a7f7a26f..19e443137f06c61e713b9ee4b998acb126a08b43 100644 (file)
@@ -19,7 +19,7 @@ export default defineConfig({
       sourcemap: true
     }
   ],
-  external: ['node:path', 'node:url', 'poolifier', 'ws'],
+  external: [/node:*/, 'poolifier', 'ws'],
   plugins: [
     typescript(),
     del({
index 6d2fc34da8437e298f208bc999592ab04acd7f0a..d4d28a19f6f3815039d2aaac567a86aad4b013c0 100644 (file)
@@ -23,7 +23,7 @@ export default defineConfig({
       sourcemap: true
     }
   ],
-  external: ['node:path', 'node:url', 'poolifier', 'ws'],
+  external: [/node:*/, 'poolifier', 'ws'],
   plugins: [
     typescript(),
     del({
index b7abc9c5430f6212c6b5e7e79aa2f351285086d2..1eca9997c4ef4ddbf26b03f095c89f0491bdff4d 100644 (file)
@@ -66,16 +66,7 @@ export default defineConfig([
         })
       }
     ],
-    external: [
-      'node:async_hooks',
-      'node:cluster',
-      'node:crypto',
-      'node:events',
-      'node:fs',
-      'node:os',
-      'node:perf_hooks',
-      'node:worker_threads'
-    ],
+    external: [/node:*/],
     plugins: [
       typescript({
         tsconfig: './tsconfig.build.json',
@@ -93,13 +84,7 @@ export default defineConfig([
   {
     input: './lib/dts/index.d.ts',
     output: [{ format: 'esm', file: './lib/index.d.ts' }],
-    external: [
-      'node:async_hooks',
-      'node:cluster',
-      'node:events',
-      'node:perf_hooks',
-      'node:worker_threads'
-    ],
+    external: [/node:*/],
     plugins: [
       dts(),
       del({