mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
fix: bundle CLI with Vite (#6893)
* fix: bundle CLI with Vite * bundle dependencies as well * remove unused dependencies
This commit is contained in:
parent
329659b2fb
commit
b4c211cad1
4 changed files with 178 additions and 638 deletions
772
cli/package-lock.json
generated
772
cli/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -12,16 +12,8 @@
|
||||||
"immich",
|
"immich",
|
||||||
"cli"
|
"cli"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
|
||||||
"@immich/sdk": "file:../open-api/typescript-sdk",
|
|
||||||
"axios": "^1.6.7",
|
|
||||||
"byte-size": "^8.1.1",
|
|
||||||
"cli-progress": "^3.12.0",
|
|
||||||
"commander": "^11.0.0",
|
|
||||||
"glob": "^10.3.1",
|
|
||||||
"yaml": "^2.3.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@immich/sdk": "file:../open-api/typescript-sdk",
|
||||||
"@testcontainers/postgresql": "^10.4.0",
|
"@testcontainers/postgresql": "^10.4.0",
|
||||||
"@types/byte-size": "^8.1.0",
|
"@types/byte-size": "^8.1.0",
|
||||||
"@types/cli-progress": "^3.11.0",
|
"@types/cli-progress": "^3.11.0",
|
||||||
|
@ -30,19 +22,24 @@
|
||||||
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
||||||
"@typescript-eslint/parser": "^6.4.1",
|
"@typescript-eslint/parser": "^6.4.1",
|
||||||
"@vitest/coverage-v8": "^1.2.2",
|
"@vitest/coverage-v8": "^1.2.2",
|
||||||
|
"axios": "^1.6.7",
|
||||||
|
"byte-size": "^8.1.1",
|
||||||
|
"cli-progress": "^3.12.0",
|
||||||
|
"commander": "^11.0.0",
|
||||||
"eslint": "^8.56.0",
|
"eslint": "^8.56.0",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"eslint-plugin-unicorn": "^50.0.1",
|
"eslint-plugin-unicorn": "^50.0.1",
|
||||||
|
"glob": "^10.3.1",
|
||||||
"immich": "file:../server",
|
"immich": "file:../server",
|
||||||
"mock-fs": "^5.2.0",
|
"mock-fs": "^5.2.0",
|
||||||
"ts-node": "^10.9.1",
|
|
||||||
"tslib": "^2.5.3",
|
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3",
|
||||||
"vitest": "^1.2.1"
|
"vite": "^5.0.12",
|
||||||
|
"vitest": "^1.2.1",
|
||||||
|
"yaml": "^2.3.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc --project tsconfig.build.json",
|
"build": "vite build",
|
||||||
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" --max-warnings 0",
|
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" --max-warnings 0",
|
||||||
"lint:fix": "npm run lint -- --fix",
|
"lint:fix": "npm run lint -- --fix",
|
||||||
"prepack": "npm run build",
|
"prepack": "npm run build",
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"extends": "./tsconfig.json",
|
|
||||||
"exclude": ["dist", "node_modules", "upload", "test", "**/*spec.ts"]
|
|
||||||
}
|
|
17
cli/vite.config.ts
Normal file
17
cli/vite.config.ts
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
input: 'src/index.ts',
|
||||||
|
output: {
|
||||||
|
dir: 'dist',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ssr: true,
|
||||||
|
},
|
||||||
|
ssr: {
|
||||||
|
// bundle everything except for Node built-ins
|
||||||
|
noExternal: /^(?!node:).*$/,
|
||||||
|
},
|
||||||
|
});
|
Loading…
Reference in a new issue