1234567891011121314151617181920212223242526272829303132333435363738 |
- const path = require('path')
- module.exports = {
- // 基本路径
- publicPath: './',
- // 输出文件目录
- outputDir: 'dist',
- configureWebpack: {
- externals: {
- }
- },
- devServer: {
- proxy: {
- '/api': {
- target: 'http://localhost:8080',
- changeOrigin: true,
- ws: true,
- pathRewrite: {
- '^/api': '/mock'
- }
- }
- },
- public: require('os').networkInterfaces()[Object.keys(require('os').networkInterfaces())[0]][1].address + ':8080',
- disableHostCheck: true
- }
- // productionSourceMap: false,
- // devServer: {
- // proxy: {
- // '/test': {
- // target: "http://47.105.143.227:3000",//这个是你要访问的接口地址
- // changeOrigin: true,
- // pathRewrite: {//重写地址 比如说 你的接口地址是'https://188.62.63/xxyy/getUser' 你请求得时候地址只需要写'/test/getUser'
- // '/test': '/xxyy'
- // }
- // }
- // }
- // }
- }
|