Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65d4c7bcf8 | ||
|
|
518d937e5c |
@@ -50,7 +50,7 @@ RUN rm -rf /etc/nginx/conf.d/default.conf
|
|||||||
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
# 从构建阶段复制构建产物(UniApp H5 输出目录)
|
# 从构建阶段复制构建产物(UniApp H5 输出目录)
|
||||||
COPY --from=builder /build/dist/build/h5 /usr/share/nginx/html/h5
|
COPY --from=builder /build/dist/build/h5/ /usr/share/nginx/html/
|
||||||
|
|
||||||
# 暴露端口
|
# 暴露端口
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -27,16 +27,8 @@ server {
|
|||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /h5/ {
|
location / {
|
||||||
try_files $uri $uri/ /h5/index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
|
||||||
|
|
||||||
location = /h5 {
|
|
||||||
return 301 /h5/;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = / {
|
|
||||||
return 301 /h5/;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||||
|
|||||||
@@ -17,9 +17,8 @@ export default defineConfig(({ command, mode }): UserConfig => {
|
|||||||
console.log('环境变量 env -> ', env);
|
console.log('环境变量 env -> ', env);
|
||||||
|
|
||||||
const isBuild = process.env.NODE_ENV === 'production';
|
const isBuild = process.env.NODE_ENV === 'production';
|
||||||
// const base = ['development', 'test'].includes(mode) ? '/h5/' : '/';
|
|
||||||
return {
|
return {
|
||||||
base: '/h5/',
|
base: '/',
|
||||||
// 自定义env目录
|
// 自定义env目录
|
||||||
envDir: './env',
|
envDir: './env',
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
Reference in New Issue
Block a user