Просмотр исходного кода

fix: remove base from vite config, use nginx dual-location for preview

- index.html uses relative paths (./src/, ./assets/) so browser resolves them
  correctly under /ads-preview/ page URL
- Removed base from vite.config.js (Vite dev server doesn't apply it to HTML)
- nginx /ads-preview/ location strips prefix (trailing slash in proxy_pass)
- nginx needs NEW location ^~ /@vite/ to catch Vite's absolute-path injections
guoziyun 3 недель назад
Родитель
Сommit
df9b197450
1 измененных файлов с 0 добавлено и 2 удалено
  1. 0 2
      templates/coloring/vite.config.js

+ 0 - 2
templates/coloring/vite.config.js

@@ -43,8 +43,6 @@ module.exports = defineConfig(({ mode }) => {
   const outDir = output ? `dist/${output}` : "dist";
 
   return {
-    // 预览模式下通过 PREVIEW_BASE_PATH 设置 base 路径,如 /ads-preview/
-    base: process.env.PREVIEW_BASE_PATH || undefined,
     plugins: [viteSingleFile(), finalizeHtmlPlugin(outDir, adapter)],
     server: {
       allowedHosts: ["color2.jccytech.cn", "localhost", ".jccytech.cn"],