aboutsummaryrefslogtreecommitdiffstats
path: root/apps/cli
diff options
context:
space:
mode:
Diffstat (limited to 'apps/cli')
-rw-r--r--apps/cli/package.json7
-rw-r--r--apps/cli/src/index.ts1
-rw-r--r--apps/cli/vite.config.mts9
3 files changed, 13 insertions, 4 deletions
diff --git a/apps/cli/package.json b/apps/cli/package.json
index 778433ee..2b6f2cd5 100644
--- a/apps/cli/package.json
+++ b/apps/cli/package.json
@@ -26,11 +26,12 @@
"commander": "^12.0.0",
"superjson": "^2.2.1",
"table": "^6.8.2",
- "tsx": "^4.7.1",
- "vite": "^5.1.0"
+ "tsx": "^4.8.1",
+ "vite": "^7.0.6",
+ "vite-tsconfig-paths": "^4.3.1"
},
"scripts": {
- "build": "vite build",
+ "build": "vite build && chmod +x dist/index.mjs",
"run": "tsx src/index.ts",
"lint": "oxlint .",
"lint:fix": "oxlint . --fix",
diff --git a/apps/cli/src/index.ts b/apps/cli/src/index.ts
index 7d6c1472..cfb1d520 100644
--- a/apps/cli/src/index.ts
+++ b/apps/cli/src/index.ts
@@ -1,4 +1,3 @@
-#! /usr/bin/env node
import { bookmarkCmd } from "@/commands/bookmarks";
import { listsCmd } from "@/commands/lists";
import { tagsCmd } from "@/commands/tags";
diff --git a/apps/cli/vite.config.mts b/apps/cli/vite.config.mts
index 81717bff..161d206a 100644
--- a/apps/cli/vite.config.mts
+++ b/apps/cli/vite.config.mts
@@ -9,9 +9,14 @@ export default defineConfig({
input: "src/index.ts",
output: {
dir: "dist",
+ format: "es",
+ entryFileNames: "index.mjs",
+ banner: "#!/usr/bin/env node",
},
+ external: ["node:fs", "node:path", "node:url", "node:process"],
},
ssr: true,
+ target: "node18",
},
ssr: {
// bundle everything except for Node built-ins
@@ -23,4 +28,8 @@ export default defineConfig({
process.env.npm_package_version,
),
},
+ esbuild: {
+ // Handle shebang in source files
+ banner: "",
+ },
});