refactor(cli): build with vite-plus instead of tsup

This commit is contained in:
2026-09-06 22:28:58 +02:00
parent 2f4ebb90e6
commit 6a4d40e7be
3 changed files with 22 additions and 23 deletions
-16
View File
@@ -1,16 +0,0 @@
import { build } from 'tsup'
import pkg from './package.json' with { type: 'json' }
const watch = process.argv.slice(2)[0] === '--watch'
await build({
entry: ['src/index.ts', 'src/cli.ts'],
dts: true,
minify: true,
format: ['esm'],
target: 'es2022',
clean: true,
noExternal: ['@cryptgeon/shared'],
define: { VERSION: `"${pkg.version}"` },
watch,
})
+8 -7
View File
@@ -9,18 +9,18 @@
},
"type": "module",
"exports": {
".": "./dist/index.js"
".": "./dist/index.mjs"
},
"types": "./dist/index.d.ts",
"types": "./dist/index.d.mts",
"bin": {
"cryptgeon": "./dist/cli.js"
"cryptgeon": "./dist/cli.mjs"
},
"files": [
"dist"
],
"scripts": {
"build": "node build.js",
"dev": "node build.js --watch",
"build": "vp pack",
"dev": "vp pack --watch",
"prepublishOnly": "run-s build"
},
"dependencies": {
@@ -32,11 +32,12 @@
"pretty-bytes": "^6.1.1"
},
"devDependencies": {
"@tsconfig/strictest": "catalog:",
"@types/inquirer": "^9.0.9",
"@types/node": "^22.15.3",
"commander": "^12.1.0",
"tsup": "^8.5.1",
"typescript": "^5.9.3"
"typescript": "catalog:",
"vite-plus": "catalog:"
},
"engines": {
"node": ">=22"
+14
View File
@@ -0,0 +1,14 @@
import { defineConfig } from "vite-plus";
import pkg from "./package.json" with { type: "json" };
export default defineConfig({
pack: {
entry: ["src/index.ts", "src/cli.ts"],
dts: true,
minify: true,
format: ["esm"],
target: "es2023",
deps: { alwaysBundle: ["**"] },
define: { VERSION: JSON.stringify(pkg.version) },
},
});