| | |
| | | const path = require('path') |
| | | const path = require("path"); |
| | | function resolve(dir) { |
| | | return path.join(__dirname, dir) |
| | | return path.join(__dirname, dir); |
| | | } |
| | | module.exports = { |
| | | outputDir: 'culture', // 配置打包后的文件夹名称 |
| | | lintOnSave: false, |
| | | publicPath: '/', |
| | | devServer: { |
| | | disableHostCheck: true, //禁用主机检查 |
| | | proxy: { |
| | | "/api": { // 设置以什么前缀开头的请求用来代理 |
| | | target: "http://192.168.110.34:8081", //要访问的跨域的域名 |
| | | secure: false, // 使用的是http协议则设置为false,https协议则设置为true |
| | | changOrigin: true, //开启代理 |
| | | pathRewrite: { |
| | | "^/api": "/api", |
| | | }, |
| | | }, |
| | | outputDir: "culture", // 配置打包后的文件夹名称 |
| | | lintOnSave: false, |
| | | publicPath: "/", |
| | | devServer: { |
| | | disableHostCheck: true, //禁用主机检查 |
| | | proxy: { |
| | | "/api": { |
| | | // 设置以什么前缀开头的请求用来代理 |
| | | // target: "http://221.182.45.100:8081", //要访问的跨域的域名 |
| | | target: "http://localhost:8082", |
| | | secure: false, // 使用的是http协议则设置为false,https协议则设置为true |
| | | changeOrigin: true, //开启代理 |
| | | pathRewrite: { |
| | | "^/api": "/api", |
| | | }, |
| | | }, |
| | | "/": { |
| | | // 设置以什么前缀开头的请求用来代理 |
| | | // target: "http://221.182.45.100:8081", //要访问的跨域的域名 |
| | | target: "http://localhost:8082", |
| | | secure: false, // 使用的是http协议则设置为false,https协议则设置为true |
| | | changeOrigin: true, //开启代理 |
| | | pathRewrite: { |
| | | "^/": "/", |
| | | }, |
| | | }, |
| | | "/open": { |
| | | // 设置以什么前缀开头的请求用来代理 |
| | | // target: "http://221.182.45.100:8081", //要访问的跨域的域名 |
| | | target: "http://localhost:8082", |
| | | secure: false, // 使用的是http协议则设置为false,https协议则设置为true |
| | | changeOrigin: true, //开启代理 |
| | | pathRewrite: { |
| | | "^/open": "/", |
| | | }, |
| | | }, |
| | | }, |
| | | configureWebpack: { |
| | | resolve: { |
| | | alias: { |
| | | '@': resolve('src'), |
| | | } |
| | | }, |
| | | configureWebpack: { |
| | | resolve: { |
| | | alias: { |
| | | "@": resolve("src"), |
| | | }, |
| | | }, |
| | | module: { |
| | | rules: [ |
| | | { |
| | | test: /\.m?js$/, |
| | | include: /node_modules/, |
| | | type: "javascript/auto", |
| | | use: { |
| | | loader: "babel-loader", |
| | | options: { |
| | | presets: ["@babel/preset-env"], |
| | | plugins: ["@babel/plugin-proposal-nullish-coalescing-operator"], |
| | | }, |
| | | }, |
| | | }, |
| | | module: { |
| | | rules: [ |
| | | { |
| | | test: /\.m?js$/, |
| | | include: /node_modules/, |
| | | type: "javascript/auto", |
| | | use: { |
| | | loader: 'babel-loader', |
| | | options: { |
| | | presets: ['@babel/preset-env'], |
| | | plugins: ['@babel/plugin-proposal-nullish-coalescing-operator'] |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }; |
| | | ], |
| | | }, |
| | | }, |
| | | }; |