tfse-app-webapp-v0.2/vue.config.js

50 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module.exports = {
publicPath: process.env.NODE_ENV === "production" ? "./" : "./",
outputDir: "dist",
productionSourceMap: false,
lintOnSave: true,
runtimeCompiler: true,
css: {
loaderOptions: {
sass: {
prependData: `@import "@/assets/sass/_variable.scss";`
}
}
},
configureWebpack: {
resolve: {
alias: {
components: "@/components",
assets: "@/assets",
api: "@/api",
view: "@/view",
router: "@/router",
utils: "@/utils",
store: "@/store"
},
},
},
devServer: {
open: false,//open 在devServer启动且第一次构建完成时自动用我们的系统的默认浏览器去打开要开发的网页
host: 'localhost',//默认是 localhost。如果你希望服务器外部可访问指定如下 host: '0.0.0.0'设置之后之后可以访问ip地址
port: 8081,
hot: true,//hot配置是否启用模块的热替换功能devServer的默认行为是在发现源代码被变更后通过自动刷新整个页面来做到事实预览开启hot后将在不刷新整个页面的情况下通过新模块替换老模块来做到实时预览。
https: false,
hotOnly: false,// hot 和 hotOnly 的区别是在某些模块不支持热更新的情况下,前者会自动刷新页面,后者不会刷新页面,而是在控制台输出热更新失败
proxy: {
'/api': {
target: 'http://116.63.130.34:30000/', //目标接口域名
secure: false, //false为http访问true为https访问
changeOrigin: true, //是否跨域
pathRewrite: {
'^/api': '' //重写接口
}
}
}, // 设置代理
before: app => { }
},
// 第三方插件配置
pluginOptions: {
// ...
}
}