module.exports = { publicPath: './', css: { // 是否使用css分离插件 ExtractTextPlugin extract: false, // 开启 CSS source maps? sourceMap: true, // css预设器配置项 loaderOptions: {}, // 启用 CSS modules for all css / pre-processor files. modules: false }, runtimeCompiler: true, devServer: { open: true, host: 'localhost', port: 8085, https: false, //以上的ip和端口是我们本机的;下面为需要跨域的 proxy: {//配置跨域 'email': { target: 'http://localhost:8083/', //这里后台的地址模拟的;应该填写你们真实的后台接口 ws: true, changOrigin: true, //允许跨域 pathRewrite: { '^/email': '/email'//请求的时候使用这个api就可以 } }, 'obpm': { target: 'http://localhost:8083/', //这里后台的地址模拟的;应该填写你们真实的后台接口 ws: true, changOrigin: true, //允许跨域 pathRewrite: { '^/obpm': '/obpm'//请求的时候使用这个api就可以 } }, } } }