vue2打包部署问题

发布时间 2023-11-09 13:56:54作者: __username

本地部署

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  // devServer: {
  //   open: true,
  //   host: 'localhost',
  //   port: 8888
  // },
  publicPath: './',  //本地的
  // publicPath: '/',  // 服务【线上】
})

服务器部署


注意

错误案例


原因 1.root下的目录没权限【我这里是文件权限问题】

解决

直接放到 /根目录下了