vue-cli 部署到子目录


生产环境打包到子目录

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/;
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM