From: Jérôme Benoit Date: Mon, 28 Aug 2023 21:46:03 +0000 (+0200) Subject: build: cleanup build paths X-Git-Tag: v2.6.38~19 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=78cdf6bc0f67d72967aaeb948ec81479f875386b;p=poolifier.git build: cleanup build paths Signed-off-by: Jérôme Benoit --- diff --git a/examples/typescript/http-server-pool/express-cluster/rollup.config.mjs b/examples/typescript/http-server-pool/express-cluster/rollup.config.mjs index 4e0a0317..5bbe0046 100644 --- a/examples/typescript/http-server-pool/express-cluster/rollup.config.mjs +++ b/examples/typescript/http-server-pool/express-cluster/rollup.config.mjs @@ -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/*'] }) ] } diff --git a/examples/typescript/http-server-pool/express-hybrid/rollup.config.mjs b/examples/typescript/http-server-pool/express-hybrid/rollup.config.mjs index 97b5cf70..0b07b4e4 100644 --- a/examples/typescript/http-server-pool/express-hybrid/rollup.config.mjs +++ b/examples/typescript/http-server-pool/express-hybrid/rollup.config.mjs @@ -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/*'] }) ] } diff --git a/examples/typescript/http-server-pool/fastify-cluster/rollup.config.mjs b/examples/typescript/http-server-pool/fastify-cluster/rollup.config.mjs index ce76fee0..1a46e998 100644 --- a/examples/typescript/http-server-pool/fastify-cluster/rollup.config.mjs +++ b/examples/typescript/http-server-pool/fastify-cluster/rollup.config.mjs @@ -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/*'] }) ] } diff --git a/examples/typescript/http-server-pool/fastify-hybrid/rollup.config.mjs b/examples/typescript/http-server-pool/fastify-hybrid/rollup.config.mjs index 0b93ba20..ecc218cf 100644 --- a/examples/typescript/http-server-pool/fastify-hybrid/rollup.config.mjs +++ b/examples/typescript/http-server-pool/fastify-hybrid/rollup.config.mjs @@ -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/*'] }) ] } diff --git a/examples/typescript/websocket-server-pool/ws-cluster/rollup.config.mjs b/examples/typescript/websocket-server-pool/ws-cluster/rollup.config.mjs index 6bc34eed..6997381d 100644 --- a/examples/typescript/websocket-server-pool/ws-cluster/rollup.config.mjs +++ b/examples/typescript/websocket-server-pool/ws-cluster/rollup.config.mjs @@ -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/*'] }) ] } diff --git a/examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.mjs b/examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.mjs index 8082e084..6f5693b9 100644 --- a/examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.mjs +++ b/examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.mjs @@ -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/*'] }) ] } diff --git a/rollup.config.mjs b/rollup.config.mjs index b1386fbd..eb622630 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -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() diff --git a/tsconfig.json b/tsconfig.json index 182a29da..65f5b57b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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