57 lines
1.6 KiB
JavaScript
57 lines
1.6 KiB
JavaScript
|
|
// 引入等比适配插件
|
|||
|
|
const px2rem = require('postcss-px2rem')
|
|||
|
|
|
|||
|
|
// 配置基本大小
|
|||
|
|
const postcss = px2rem({
|
|||
|
|
// 基准大小 baseSize,需要和rem.js中相同
|
|||
|
|
remUnit: 16
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
module.exports = {
|
|||
|
|
// publicPath: process.env.NODE_ENV == "production" ? "./" : "./",
|
|||
|
|
publicPath: './',
|
|||
|
|
devServer: {
|
|||
|
|
historyApiFallback: true,
|
|||
|
|
noInfo: true,
|
|||
|
|
proxy: {
|
|||
|
|
'/api': {
|
|||
|
|
// 是否允许跨域
|
|||
|
|
changeOrigin: true,
|
|||
|
|
// target: 'http://192.168.31.65:8022/',
|
|||
|
|
// target: 'http://192.168.0.109:8002/',
|
|||
|
|
// target: 'http://192.168.1.101:8008/',
|
|||
|
|
// target: 'http://180.76.188.13:8250/',
|
|||
|
|
// target: 'http://192.168.1.118:8022/',
|
|||
|
|
// target: 'http://127.0.0.1:8022/',
|
|||
|
|
target: 'http://localhost:8251/',
|
|||
|
|
ws: true,
|
|||
|
|
pathRewrite: {
|
|||
|
|
'^/api': ''
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
// 使用等比适配插件
|
|||
|
|
lintOnSave: true,
|
|||
|
|
css: {
|
|||
|
|
loaderOptions: {
|
|||
|
|
postcss: {
|
|||
|
|
plugins: [
|
|||
|
|
postcss
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
|
|||
|
|
// 第三方插件配置
|
|||
|
|
pluginOptions: {
|
|||
|
|
// 导入全局的less变量
|
|||
|
|
'style-resources-loader': {
|
|||
|
|
preProcessor: 'less',
|
|||
|
|
//在assets(静态资源文件夹)下创建全局样式文件;index.less 它就是less全局变量
|
|||
|
|
patterns: [require('path').resolve('./src/assets/style/index.less')]
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
}
|