首页 > 其他 > 详细

vue-cli 部署到子目录

时间:2020-01-11 00:56:16      阅读:124      评论:0      收藏:0      [点我收藏+]

生产环境打包到子目录

module.exports = {
    // baseUrl: "",
    devServer: {
        host: "0.0.0.0",
        disableHostCheck: true
    },
          publicPath: process.env.NODE_ENV === production
    ? /dist/
    : /,
        outputDir: dist,
        assetsDir: static
}

 

nginx 配置子目录路径

location /dist/ {
        try_files $uri $uri/ index.html  =404;
        error_page 404 /dist/;
}

 

vue-cli 部署到子目录

原文:https://www.cnblogs.com/fenle/p/12178690.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!