1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +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:
Ben McCann 2024-02-03 19:39:01 -08:00 committed by GitHub
parent 329659b2fb
commit b4c211cad1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 178 additions and 638 deletions

772
cli/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -12,16 +12,8 @@
"immich",
"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": {
"@immich/sdk": "file:../open-api/typescript-sdk",
"@testcontainers/postgresql": "^10.4.0",
"@types/byte-size": "^8.1.0",
"@types/cli-progress": "^3.11.0",
@ -30,19 +22,24 @@
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"@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-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^50.0.1",
"glob": "^10.3.1",
"immich": "file:../server",
"mock-fs": "^5.2.0",
"ts-node": "^10.9.1",
"tslib": "^2.5.3",
"typescript": "^5.3.3",
"vitest": "^1.2.1"
"vite": "^5.0.12",
"vitest": "^1.2.1",
"yaml": "^2.3.1"
},
"scripts": {
"build": "tsc --project tsconfig.build.json",
"build": "vite build",
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" --max-warnings 0",
"lint:fix": "npm run lint -- --fix",
"prepack": "npm run build",

View file

@ -1,4 +0,0 @@
{
"extends": "./tsconfig.json",
"exclude": ["dist", "node_modules", "upload", "test", "**/*spec.ts"]
}

17
cli/vite.config.ts Normal file
View 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:).*$/,
},
});