From 5d4b2a88ced1c4a7ec1d5e9a85590de377bdeff0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 29 Aug 2023 01:20:17 +0200 Subject: [PATCH] build: use defineConfig() in rollup configurations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../http-server-pool/express-cluster/rollup.config.mjs | 5 +++-- .../http-server-pool/express-hybrid/rollup.config.mjs | 5 +++-- .../http-server-pool/fastify-cluster/rollup.config.mjs | 5 +++-- .../http-server-pool/fastify-hybrid/rollup.config.mjs | 5 +++-- .../websocket-server-pool/ws-cluster/rollup.config.mjs | 5 +++-- .../websocket-server-pool/ws-hybrid/rollup.config.mjs | 5 +++-- rollup.config.mjs | 5 +++-- tsconfig.development.json | 2 +- 8 files changed, 22 insertions(+), 15 deletions(-) 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 5bbe0046..31a3a871 100644 --- a/examples/typescript/http-server-pool/express-cluster/rollup.config.mjs +++ b/examples/typescript/http-server-pool/express-cluster/rollup.config.mjs @@ -1,8 +1,9 @@ /* eslint-disable n/no-unpublished-import */ import typescript from '@rollup/plugin-typescript' import del from 'rollup-plugin-delete' +import { defineConfig } from 'rollup' -export default { +export default defineConfig({ input: ['./src/main.ts', './src/worker.ts'], strictDeprecations: true, output: [ @@ -29,4 +30,4 @@ export default { 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 0b07b4e4..d353be21 100644 --- a/examples/typescript/http-server-pool/express-hybrid/rollup.config.mjs +++ b/examples/typescript/http-server-pool/express-hybrid/rollup.config.mjs @@ -1,8 +1,9 @@ /* eslint-disable n/no-unpublished-import */ import typescript from '@rollup/plugin-typescript' import del from 'rollup-plugin-delete' +import { defineConfig } from 'rollup' -export default { +export default defineConfig({ input: [ './src/main.ts', './src/express-worker.ts', @@ -33,4 +34,4 @@ export default { 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 1a46e998..eee200e9 100644 --- a/examples/typescript/http-server-pool/fastify-cluster/rollup.config.mjs +++ b/examples/typescript/http-server-pool/fastify-cluster/rollup.config.mjs @@ -1,8 +1,9 @@ /* eslint-disable n/no-unpublished-import */ import typescript from '@rollup/plugin-typescript' import del from 'rollup-plugin-delete' +import { defineConfig } from 'rollup' -export default { +export default defineConfig({ input: ['./src/main.ts', './src/worker.ts'], strictDeprecations: true, output: [ @@ -29,4 +30,4 @@ export default { 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 ecc218cf..2ac38f32 100644 --- a/examples/typescript/http-server-pool/fastify-hybrid/rollup.config.mjs +++ b/examples/typescript/http-server-pool/fastify-hybrid/rollup.config.mjs @@ -1,8 +1,9 @@ /* eslint-disable n/no-unpublished-import */ import typescript from '@rollup/plugin-typescript' import del from 'rollup-plugin-delete' +import { defineConfig } from 'rollup' -export default { +export default defineConfig({ input: [ './src/main.ts', './src/fastify-worker.ts', @@ -33,4 +34,4 @@ export default { 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 6997381d..c1fe5160 100644 --- a/examples/typescript/websocket-server-pool/ws-cluster/rollup.config.mjs +++ b/examples/typescript/websocket-server-pool/ws-cluster/rollup.config.mjs @@ -1,8 +1,9 @@ /* eslint-disable n/no-unpublished-import */ import typescript from '@rollup/plugin-typescript' import del from 'rollup-plugin-delete' +import { defineConfig } from 'rollup' -export default { +export default defineConfig({ input: ['./src/main.ts', './src/worker.ts'], strictDeprecations: true, output: [ @@ -29,4 +30,4 @@ export default { 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 6f5693b9..1560be0d 100644 --- a/examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.mjs +++ b/examples/typescript/websocket-server-pool/ws-hybrid/rollup.config.mjs @@ -1,8 +1,9 @@ /* eslint-disable n/no-unpublished-import */ import typescript from '@rollup/plugin-typescript' import del from 'rollup-plugin-delete' +import { defineConfig } from 'rollup' -export default { +export default defineConfig({ input: [ './src/main.ts', './src/websocket-server-worker.ts', @@ -33,4 +34,4 @@ export default { targets: ['./dist/*'] }) ] -} +}) diff --git a/rollup.config.mjs b/rollup.config.mjs index e0c97bd6..29cc1f96 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -5,6 +5,7 @@ import typescript from '@rollup/plugin-typescript' import analyze from 'rollup-plugin-analyzer' import command from 'rollup-plugin-command' import del from 'rollup-plugin-delete' +import { defineConfig } from 'rollup' const availableParallelism = () => { let availableParallelism = 1 @@ -25,7 +26,7 @@ const isDocumentationBuild = process.env.DOCUMENTATION const maxWorkers = Math.floor(availableParallelism() / 2) -export default [ +export default defineConfig([ { input: './src/index.ts', strictDeprecations: true, @@ -100,4 +101,4 @@ export default [ isAnalyzeBuild && analyze() ] } -] +]) diff --git a/tsconfig.development.json b/tsconfig.development.json index f7aa7d0f..87915c1e 100644 --- a/tsconfig.development.json +++ b/tsconfig.development.json @@ -1,7 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "sourceMap": true, + "sourceMap": true }, "exclude": ["node_modules", "lib", "examples/typescript/**/*.ts"] } -- 2.34.1