mirror of
https://github.com/Afilmory/afilmory
synced 2026-02-01 22:48:17 +00:00
feat: add build:serve script and update build:web command for server serving, fixed #147
Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
"scripts": {
|
||||
"analyze": "analyzer=1 vite build",
|
||||
"build": "tsx scripts/build.ts",
|
||||
"build:serve": "BUILD_FOR_SERVER_SERVE=1 vite build",
|
||||
"dev": "tsx scripts/dev.ts",
|
||||
"format": "prettier --write \"src/**/*.ts\" ",
|
||||
"lint": "eslint --fix",
|
||||
@@ -109,4 +110,4 @@
|
||||
"vite-plugin-html": "3.2.2",
|
||||
"vite-plugin-pwa": "1.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,12 +48,11 @@ const ReactCompilerConfig = {
|
||||
/* ... */
|
||||
}
|
||||
|
||||
const BUILD_FOR_SERVER_SERVE = process.env.BUILD_FOR_SERVER_SERVE === '1'
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig(({ command }) => {
|
||||
const isBuild = command === 'build'
|
||||
|
||||
export default defineConfig(() => {
|
||||
return {
|
||||
base: isBuild ? '/static/web/' : '/',
|
||||
base: BUILD_FOR_SERVER_SERVE ? '/static/web/' : '/',
|
||||
plugins: [
|
||||
codeInspectorPlugin({
|
||||
bundler: 'vite',
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"build": "vite build",
|
||||
"build:web": "AFILMORY_EMBED_MANIFEST=false pnpm --filter @afilmory/web build",
|
||||
"build:web": "AFILMORY_EMBED_MANIFEST=false BUILD_FOR_SERVER_SERVE=1 pnpm --filter @afilmory/web build",
|
||||
"db:generate": "pnpm -C ../../packages/db db:generate",
|
||||
"db:migrate": "pnpm -C ../../packages/db db:migrate",
|
||||
"db:studio": "pnpm -C ../../packages/db db:studio",
|
||||
|
||||
Reference in New Issue
Block a user