build: cleanup build paths
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 28 Aug 2023 21:46:03 +0000 (23:46 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 28 Aug 2023 21:46:03 +0000 (23:46 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
examples/typescript/http-server-pool/express-cluster/rollup.config.mjs
examples/typescript/http-server-pool/express-hybrid/rollup.config.mjs
examples/typescript/http-server-pool/fastify-cluster/rollup.config.mjs
examples/typescript/http-server-pool/fastify-hybrid/rollup.config.mjs
examples/typescript/websocket-server-pool/ws-cluster/rollup.config.mjs
examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.mjs
rollup.config.mjs
tsconfig.json

index 4e0a0317e1f2074f4ceb36b8fb2ea38b35bd6d69..5bbe0046087d70e6139f2d1c1263386fdcb45365 100644 (file)
@@ -3,30 +3,30 @@ import typescript from '@rollup/plugin-typescript'
 import del from 'rollup-plugin-delete'
 
 export default {
-  input: ['src/main.ts', 'src/worker.ts'],
+  input: ['./src/main.ts', './src/worker.ts'],
   strictDeprecations: true,
   output: [
     {
       format: 'cjs',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     },
     {
       format: 'esm',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     }
   ],
   external: ['express', 'node:path', 'node:url', 'poolifier'],
   plugins: [
     typescript(),
     del({
-      targets: ['dist/*']
+      targets: ['./dist/*']
     })
   ]
 }
index 97b5cf702cb1dd197a4c1eadcefc308ae0cfc466..0b07b4e47d83c71869f169dbd7bf325d753f511e 100644 (file)
@@ -4,33 +4,33 @@ import del from 'rollup-plugin-delete'
 
 export default {
   input: [
-    'src/main.ts',
-    'src/express-worker.ts',
-    'src/request-handler-worker.ts'
+    './src/main.ts',
+    './src/express-worker.ts',
+    './src/request-handler-worker.ts'
   ],
   strictDeprecations: true,
   output: [
     {
       format: 'cjs',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     },
     {
       format: 'esm',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     }
   ],
   external: ['express', 'node:path', 'node:url', 'poolifier'],
   plugins: [
     typescript(),
     del({
-      targets: ['dist/*']
+      targets: ['./dist/*']
     })
   ]
 }
index ce76fee01c2a61fba27cfe62b05e56b174362f83..1a46e9980b6f678596701a3d6328ca74120b5c0a 100644 (file)
@@ -3,30 +3,30 @@ import typescript from '@rollup/plugin-typescript'
 import del from 'rollup-plugin-delete'
 
 export default {
-  input: ['src/main.ts', 'src/worker.ts'],
+  input: ['./src/main.ts', './src/worker.ts'],
   strictDeprecations: true,
   output: [
     {
       format: 'cjs',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     },
     {
       format: 'esm',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     }
   ],
   external: ['fastify', 'node:path', 'node:url', 'poolifier'],
   plugins: [
     typescript(),
     del({
-      targets: ['dist/*']
+      targets: ['./dist/*']
     })
   ]
 }
index 0b93ba20edc677c388ff9397b6032b24e401bdcf..ecc218cf4a116ecb154bd73ec1f5b1849f5385f4 100644 (file)
@@ -4,33 +4,33 @@ import del from 'rollup-plugin-delete'
 
 export default {
   input: [
-    'src/main.ts',
-    'src/fastify-worker.ts',
-    'src/request-handler-worker.ts'
+    './src/main.ts',
+    './src/fastify-worker.ts',
+    './src/request-handler-worker.ts'
   ],
   strictDeprecations: true,
   output: [
     {
       format: 'cjs',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     },
     {
       format: 'esm',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     }
   ],
   external: ['fastify', 'fastify-plugin', 'node:path', 'node:url', 'poolifier'],
   plugins: [
     typescript(),
     del({
-      targets: ['dist/*']
+      targets: ['./dist/*']
     })
   ]
 }
index 6bc34eed88ed9867d45c999cfa02949e8f1ba319..6997381d173afa897bd383981e87d89c3e50a7c6 100644 (file)
@@ -3,30 +3,30 @@ import typescript from '@rollup/plugin-typescript'
 import del from 'rollup-plugin-delete'
 
 export default {
-  input: ['src/main.ts', 'src/worker.ts'],
+  input: ['./src/main.ts', './src/worker.ts'],
   strictDeprecations: true,
   output: [
     {
       format: 'cjs',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     },
     {
       format: 'esm',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     }
   ],
   external: ['node:path', 'node:url', 'poolifier', 'ws'],
   plugins: [
     typescript(),
     del({
-      targets: ['dist/*']
+      targets: ['./dist/*']
     })
   ]
 }
index 8082e0845e4c9f9795dfffcbcfc35ebe4a09b016..6f5693b94098b698587430b7225af7b44b0568e4 100644 (file)
@@ -4,33 +4,33 @@ import del from 'rollup-plugin-delete'
 
 export default {
   input: [
-    'src/main.ts',
-    'src/websocket-server-worker.ts',
-    'src/request-handler-worker.ts'
+    './src/main.ts',
+    './src/websocket-server-worker.ts',
+    './src/request-handler-worker.ts'
   ],
   strictDeprecations: true,
   output: [
     {
       format: 'cjs',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       entryFileNames: '[name].cjs',
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     },
     {
       format: 'esm',
-      dir: 'dist',
+      dir: './dist',
       sourcemap: true,
       preserveModules: true,
-      preserveModulesRoot: 'src'
+      preserveModulesRoot: './src'
     }
   ],
   external: ['node:path', 'node:url', 'poolifier', 'ws'],
   plugins: [
     typescript(),
     del({
-      targets: ['dist/*']
+      targets: ['./dist/*']
     })
   ]
 }
index b1386fbdd0dea8c352c0dad28b9dac9e309be252..eb6226303a45726ce05b2916742298f9a7a0afd9 100644 (file)
@@ -27,33 +27,33 @@ const maxWorkers = Math.floor(availableParallelism() / 2)
 
 export default [
   {
-    input: 'src/index.ts',
+    input: './src/index.ts',
     strictDeprecations: true,
     output: [
       {
         format: 'cjs',
         ...(isDevelopmentBuild && {
-          dir: 'lib',
+          dir: './lib',
           sourcemap: true,
           preserveModules: true,
-          preserveModulesRoot: 'src'
+          preserveModulesRoot: './src'
         }),
         ...(!isDevelopmentBuild && {
-          file: 'lib/index.js',
+          file: './lib/index.js',
           plugins: [terser({ maxWorkers })]
         })
       },
       {
         format: 'esm',
         ...(isDevelopmentBuild && {
-          dir: 'lib',
+          dir: './lib',
           sourcemap: true,
           entryFileNames: '[name].mjs',
           preserveModules: true,
-          preserveModulesRoot: 'src'
+          preserveModulesRoot: './src'
         }),
         ...(!isDevelopmentBuild && {
-          file: 'lib/index.mjs',
+          file: './lib/index.mjs',
           plugins: [terser({ maxWorkers })]
         })
       }
@@ -75,7 +75,7 @@ export default [
           : 'tsconfig.production.json'
       }),
       del({
-        targets: ['lib/*']
+        targets: ['./lib/*']
       }),
       isAnalyzeBuild && analyze(),
       isDocumentationBuild && command('pnpm typedoc')
@@ -83,7 +83,7 @@ export default [
   },
   {
     input: './lib/dts/index.d.ts',
-    output: [{ format: 'esm', file: 'lib/index.d.ts' }],
+    output: [{ format: 'esm', file: './lib/index.d.ts' }],
     external: [
       'node:async_hooks',
       'node:cluster',
@@ -94,7 +94,7 @@ export default [
     plugins: [
       dts(),
       del({
-        targets: ['lib/dts'],
+        targets: ['./lib/dts'],
         hook: 'buildEnd'
       }),
       isAnalyzeBuild && analyze()
index 182a29da4f281ac862ba8048a3d3c477b0f8b010..65f5b57b31b381d7becc42169b5b8f4396c02763 100644 (file)
@@ -3,10 +3,10 @@
   "compilerOptions": {
     "target": "ES2022",
     "module": "ES2022",
-    "outDir": "lib",
+    "outDir": "./lib",
     "moduleResolution": "Node",
     "declaration": true,
-    "declarationDir": "lib/dts",
+    "declarationDir": "./lib/dts",
     "strict": true,
     "verbatimModuleSyntax": true,
     "forceConsistentCasingInFileNames": true