vue项目热更新

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    port: 8080,//默认端口
    open: true,//启动项目打开浏览器
    hot: true,//热更新
  },
})

vue.config.js配置

设置之后记得要重新运行项目

devServer   hot设为true,每次保存代码自动更新

devServer   open设为true,启动项目自动打开浏览器

猜你喜欢

转载自blog.csdn.net/qq_45600228/article/details/131973986