mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-09-26 20:41:45 +00:00
refactor(cli): build with vite-plus instead of tsup
This commit is contained in:
@@ -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,
|
||||
})
|
||||
@@ -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"
|
||||
|
||||
@@ -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) },
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user