vite打包后,html和静态资源放在不同的目录下 #13919
Unanswered
2356874721
asked this question in
Q&A
Replies: 1 comment
-
有同样需求... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
vite打包后,html需要由后端渲染成一个访问路径如:https://a.xx.com,而静态资源统一放到一个webroot/static目录下,该目录会统一配置成一个https://b.xx.com域名,这是一个静态域名,放在一个单独的机器上。因此需要将html和静态资源分别输出到不同的目录,该如何配置。以下是我的代码:
这样实现的是所有文件都在dist下,如果我将outDir改成webroot/static目录,所有文件都会输出到webroot/static目录。该如何把html和静态资源拆开呢?试过assetsDir,这个只能相对于outDir,不能超出outDir
Beta Was this translation helpful? Give feedback.
All reactions