| | |
| | | const path = require("path") |
| | | // 基础路径 注意发布之前要先修改这里 |
| | | const publicPath = "/" |
| | | const publicPath = "./"; |
| | | function resolve(dir) { |
| | | return path.join(__dirname, dir) |
| | | } |
| | | |
| | | // 设置不参与构建的库 |
| | | const externals = {} |
| | | const externals = {}; |
| | | //const devServerPath ="http://wms.smartai.com:7013" //"http://wms.smartai.com:7013" http://192.168.20.119:8001 |
| | | const ipNum=46; |
| | | //const devServerPath=`http://192.168.0.${ipNum}:8005`; |
| | | //const devServerPath="http://192.168.0.101:8005"; |
| | | const devServerPath="http://wms.fai365.com"; |
| | | module.exports = { |
| | | publicPath, |
| | | lintOnSave: false, |
| | | productionSourceMap: false, // 如果你不需要生产环境的source map, 可以将其设置为false 以加速生产环境构建 |
| | | devServer: { |
| | | //host:'wms.navicat.com', |
| | | port: 9081, // 端口号 |
| | | proxy: { |
| | | "/api-s": { |
| | | target: "http://192.168.20.119:8005", |
| | | target: devServerPath, // |
| | | // target:"http://fai365.com:9083", // |
| | | ws: true, |
| | | changeOrigin: true |
| | | }, |
| | | "/api-wms": { |
| | | target: "http://192.168.20.119:8005", |
| | | target: devServerPath, |
| | | // target:"http://fai365.com:9083", |
| | | ws: true, |
| | | changeOrigin: true |
| | | } |
| | | }, |
| | | "/api/menu": { |
| | | //target: `http://192.168.0.${ipNum}:8001`, |
| | | target:devServerPath, |
| | | //注: 暂时使用====用戶权限,角色暂时用的环境 |
| | | // target: "http://192.168.20.119:8011", |
| | | ws: true, |
| | | changeOrigin: true, |
| | | }, |
| | | } |
| | | }, |
| | | transpileDependencies: [ |
| | |
| | | "crypto-js", |
| | | "sockjs-client" |
| | | ], |
| | | configureWebpack: (config) => { |
| | | configureWebpack: () => { |
| | | const configNew = {} |
| | | if (process.env.NODE_ENV === "production") { |
| | | configNew.externals = externals |
| | | configNew.plugins = [] |
| | | } else if (process.env.NODE_ENV === "development") { |
| | | console.log("development", config) |
| | | // console.log("development", config) |
| | | } |
| | | return configNew |
| | | }, |