Commit ce74c2f7 by zhangxingmin

配置 test

parent 7b722871
......@@ -29,15 +29,22 @@ WORKDIR /app
# 复制包管理文件
COPY package.json ./
# 安装项目依赖
# 1. 显式安装 esbuild 二进制
RUN npm install @esbuild/linux-x64 --verbose --registry=https://registry.npmmirror.com
# 2. 安装其他原生模块
RUN npm install canvas@2.11.2 --verbose --ignore-scripts
RUN npm install sharp@0.32.6 --verbose --ignore-scripts
# 3. 安装项目依赖(移除 --no-optional)
RUN npm install --verbose --registry=https://registry.npmmirror.com
# 复制源码和环境配置文件
COPY . .
# 确保环境文件被正确复制
COPY .env.testelopment .env.testelopment
# 4. 验证 esbuild 安装
RUN ls -la node_modules/esbuild/bin && \
./node_modules/.bin/esbuild --version
# 使用测试环境构建
# 复制源码并构建
COPY . .
RUN npm run build:test
# 生产阶段
......
......@@ -7,10 +7,12 @@
"type": "module",
"scripts": {
"dev": "vite",
"build:prod": "vite build",
"build:test": "vite build --mode testelopment",
"build:stage": "vite build --mode staging",
"preview": "vite preview"
"build": "vite build",
"test": "vite --mode=test",
"build:dev": "vite build --mode=development",
"build:test": "vite build --mode=test",
"preview": "vite preview",
"report": "npm run build --report"
},
"repository": {
"type": "git",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment