生产环境打包到子目录

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

 

相关文章:

  • 2021-08-29
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2022-12-23
  • 2021-09-24
  • 2022-01-31
猜你喜欢
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案