mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-09-27 04:51: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",
|
"type": "module",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./dist/index.js"
|
".": "./dist/index.mjs"
|
||||||
},
|
},
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.mts",
|
||||||
"bin": {
|
"bin": {
|
||||||
"cryptgeon": "./dist/cli.js"
|
"cryptgeon": "./dist/cli.mjs"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node build.js",
|
"build": "vp pack",
|
||||||
"dev": "node build.js --watch",
|
"dev": "vp pack --watch",
|
||||||
"prepublishOnly": "run-s build"
|
"prepublishOnly": "run-s build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -32,11 +32,12 @@
|
|||||||
"pretty-bytes": "^6.1.1"
|
"pretty-bytes": "^6.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@tsconfig/strictest": "catalog:",
|
||||||
"@types/inquirer": "^9.0.9",
|
"@types/inquirer": "^9.0.9",
|
||||||
"@types/node": "^22.15.3",
|
"@types/node": "^22.15.3",
|
||||||
"commander": "^12.1.0",
|
"commander": "^12.1.0",
|
||||||
"tsup": "^8.5.1",
|
"typescript": "catalog:",
|
||||||
"typescript": "^5.9.3"
|
"vite-plus": "catalog:"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=22"
|
"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