码迷,mamicode.com
首页 > 其他好文 > 详细

vue-cli 部署到子目录

时间:2020-01-11 00:07:15      阅读:81      评论:0      收藏:0      [点我收藏+]

标签:rod   ==   生产   nbsp   roc   col   cti   部署   ESS   

生产环境打包到子目录

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 部署到子目录

标签:rod   ==   生产   nbsp   roc   col   cti   部署   ESS   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!