123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- // see http://vuejs-templates.github.io/webpack for documentation.
- var path = require("path");
- // const TEST_HOST = "http://101.36.160.140:10310";
- const TEST_HOST = "http://172.16.0.46:9025";
- // const TEST_HOST = "http://172.16.0.46:9527";
- module.exports = {
- build: {
- prodEnv: require("./prod.env"),
- index: path.resolve(__dirname, "../dist/index.html"),
- assetsRoot: path.resolve(__dirname, "../dist"),
- assetsSubDirectory: "static",
- assetsPublicPath: "./", //请根据自己路径配置更改
- productionSourceMap: false,
- baseURL: TEST_HOST,
- // Gzip off by default as many popular static hosts such as
- // Surge or Netlify already gzip all static assets for you.
- // Before setting to `true`, make sure to:
- // npm install --save-dev compression-webpack-plugin
- productionGzip: false,
- productionGzipExtensions: ["js", "css"],
- // Run the build command with an extra argument to
- // View the bundle analyzer report after build finishes:
- // `npm run build --report`
- // Set to `true` or `false` to always turn it on or off
- bundleAnalyzerReport: process.env.npm_config_report,
- },
- dev: {
- host: "localhost", // can be overwritten by process.env.HOST
- env: require("./dev.env"),
- port: 9527,
- autoOpenBrowser: true,
- assetsSubDirectory: "static",
- assetsPublicPath: "/",
- proxyTable: {
- "/depot-system": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-smart-storage": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-business": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-agent": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-basic": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-storage": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-qualitycheck": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- logLevel: "debug",
- // onProxyReq: (proxyReq, req) => {
- // // http请求
- // // console.log('[HPM] %s %s %s %s', req.method, req.originalUrl, '->', req.url);
- // console.log('proxyReq', proxyReq.headers);
- // console.log('req', req.headers);
- // },
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-device": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-keeper-account": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-agile": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-monitor": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/depot-smart-storage": {
- target: TEST_HOST,
- secure: false, // 如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/api": "",
- },
- },
- "/loginApi": {
- target: TEST_HOST,
- secure: false, //如果是https接口,需要配置这个参数
- changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
- pathRewrite: {
- "^/loginApi": "",
- },
- },
- },
- // CSS Sourcemaps off by default because relative paths are "buggy"
- // with this option, according to the CSS-Loader README
- // (https://github.com/webpack/css-loader#sourcemaps)
- // In our experience, they generally work as expected,
- // just be aware of this issue when enabling this option.
- cssSourceMap: false,
- },
- };
|