From a7f7cd1aaf7b6b6eabc41c5baeab0992719e7b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20M=C3=BCller?= Date: Sat, 27 Jul 2024 15:27:34 +0200 Subject: [PATCH] Replace rollup with tsup --- package.json | 5 ++--- rollup.config.js | 20 -------------------- tsup.config.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 23 deletions(-) delete mode 100644 rollup.config.js create mode 100644 tsup.config.ts diff --git a/package.json b/package.json index 5b6afed1..447c42c2 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "node": ">=14.0.0" }, "devDependencies": { - "@rollup/plugin-typescript": "^11.1.6", "@types/expect": "^24.3.0", "@types/lodash": "^4.14.144", "@types/node": "^18.7.14", @@ -31,12 +30,12 @@ "lodash": "^4.17.15", "np": "^10.0.0", "prettier": "^3.2.5", - "rollup": "^4.12.1", + "tsup": "^8.2.3", "typescript": "^4.8.3", "vitest": "^1.6.0" }, "scripts": { - "build": "rm -rf ./{dist} && rollup --config ./rollup.config.js", + "build": "rm -rf ./{dist} && tsup", "clean": "rm -rf ./{dist,node_modules}", "fix": "npm run fix:eslint && npm run fix:prettier", "fix:eslint": "npm run lint:eslint --fix", diff --git a/rollup.config.js b/rollup.config.js deleted file mode 100644 index aeb0c858..00000000 --- a/rollup.config.js +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig } from 'rollup' -import typescript from '@rollup/plugin-typescript' - -export default defineConfig({ - input: './src/index.ts', - plugins: [typescript()], - output: [ - { - file: './dist/index.mjs', - format: 'esm', - sourcemap: true, - }, - { - file: './dist/index.cjs', - format: 'umd', - name: 'Superstruct', - sourcemap: true, - }, - ], -}) diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 00000000..72f3d1d7 --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from 'tsup' + +export default defineConfig({ + entry: ['src/index.ts'], + sourcemap: true, + dts: true, + format: ['cjs', 'esm', 'iife'], + globalName: 'Superstruct', +})