美文网首页
Vue开发环境配置及打包设置

Vue开发环境配置及打包设置

作者: Xiewb | 来源:发表于2019-07-19 11:01 被阅读0次

前言

本文所写内容是在我上一篇所写的 Vue CLI创建项目 基础上进行的。

与Spring Boot的thymeleaf集成

  1. 将vue项目移到src/main目录下
  2. vue项目根目录创建vue.config.js
module.exports = {
  publicPath: process.env.NODE_ENV === 'production' ? './ui' : '/',
  outputDir: process.env.NODE_ENV === 'production' ? '../resources/static/ui' : 'dist',
  indexPath: process.env.NODE_ENV === 'production' ? '../../templates/ui/index.html' : 'index.html',
  devServer: {
    proxy: 'http://localhost:8888/test'
  }
}

命令说明

  1. 开发环境下运行npm run serve
  2. 生产环境下运行npm run build

相关文章

网友评论

      本文标题:Vue开发环境配置及打包设置

      本文链接:https://www.haomeiwen.com/subject/iikjlctx.html