58 lines
2.0 KiB
JavaScript
58 lines
2.0 KiB
JavaScript
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: {
|
||
// externals: {
|
||
// 'vue': 'Vue',
|
||
// 'element-ui': 'ELEMENT',
|
||
// 'vue-router': 'VueRouter',
|
||
// 'vuex': 'Vuex',
|
||
// 'axios': 'axios',
|
||
// 'echarts': 'echarts'
|
||
// },
|
||
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: {
|
||
// ...
|
||
}
|
||
} |