226 lines
6.5 KiB
JavaScript
226 lines
6.5 KiB
JavaScript
'use strict'
|
|
// Template version: 1.3.1
|
|
// see http://vuejs-templates.github.io/webpack for documentation.
|
|
|
|
const path = require('path')
|
|
|
|
module.exports = {
|
|
dev: {
|
|
// Paths
|
|
assetsSubDirectory: 'static',
|
|
assetsPublicPath: '/',
|
|
proxyTable: {
|
|
'/api/': {
|
|
// 老接口
|
|
target: 'http://www.jxc4.com/api',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/api/': '/', // 把 /api/ 替换成 / 然后把地址加载 target后面进行请求
|
|
}
|
|
},
|
|
'/v3/': {
|
|
// 后端本地调试接口
|
|
target: 'http://192.168.0.63:8080/v2',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/v3/': '/', // 把 /v3/ 替换成 / 然后把地址加载 target后面进行请求
|
|
}
|
|
},
|
|
'/mock/': {
|
|
// 老接口
|
|
target: 'https://easy-mock.com/mock/5b8cca6d9896546ad1f1c89a/mock',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/mock/': '/', // 把 /api/ 替换成 / 然后把地址加载 target后面进行请求
|
|
}
|
|
},
|
|
'/v2/': {
|
|
// 新接口
|
|
// target: 'http://api.jxc4.com/v2',
|
|
// target: 'http://alpha.jxc4.com/v2', // 对应真实数据,修改后不会向平台提交
|
|
target: 'http://www.jxc4.com/beta/v2', // 正式环境
|
|
// target: 'http://192.168.56.1:8080/', // 后端api
|
|
// target: 'http://alpha3.jxc4.com/v2', // 对应京东,修改后会提交
|
|
// target: 'http://www-gblm.jxc4.com/v2', // 百货 / 宠物
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/v2/': '/'
|
|
}
|
|
},
|
|
'/c1/': { //冲天猴接口
|
|
// 新接口
|
|
// target: 'http://api.jxc4.com/v2',
|
|
// target: 'http://alpha.jxc4.com/v2', // 对应真实数据,修改后不会向平台提交
|
|
target: 'https://www.jxcs.net/v2', // 正式环境
|
|
// target: 'http://alpha3.jxc4.com/v2', // 对应京东,修改后会提交
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/c1/': '/'
|
|
}
|
|
},
|
|
'/v1/': {
|
|
// 新接口
|
|
// target: 'http://api.jxc4.com/v2',
|
|
// target: 'http://alpha.jxc4.com/v2', // 对应真实数据,修改后不会向平台提交
|
|
target: 'http://www.jxc4.com/v2', // 正式环境
|
|
// target: 'http://192.168.56.1:8080', // 后端api
|
|
// target: 'http://www-jxgy.jxc4.com/v2', // 京西果园
|
|
// target: 'http://www-gblm.jxc4.com/v2', // 百货 / 宠物
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/v1/': '/'
|
|
}
|
|
},
|
|
'/jd/': {
|
|
// 新接口
|
|
target: 'https://daojia.jd.com',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/jd/': '/'
|
|
}
|
|
},
|
|
'/jd2/': {
|
|
// 新接口
|
|
target: 'http://store.jd.com',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/jd2/': '/'
|
|
}
|
|
},
|
|
'/sta-store.jddj.com/': {
|
|
// 新接口
|
|
target: 'https://sta-store.jddj.com',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/sta-store.jddj.com/': '/'
|
|
}
|
|
},
|
|
'/ebaiapi/': {
|
|
// 新接口
|
|
target: 'https://be.ele.me',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/ebaiapi/': '/'
|
|
}
|
|
},
|
|
'/opendjapi/': {
|
|
// 新接口
|
|
target: 'https://opendj.jd.com',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/opendjapi/': '/'
|
|
}
|
|
},
|
|
'/openjddjapi/': {
|
|
// 新接口
|
|
target: 'https://openapi.jddj.com',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/openjddjapi/': '/'
|
|
}
|
|
},
|
|
'/test/': {
|
|
// 新接口
|
|
target: 'https://dfsc.imdada.cn',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/test/': '/'
|
|
}
|
|
},
|
|
'/mtTest/': {
|
|
// 新接口
|
|
target: 'http://i.waimai.meituan.com',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/mtTest/': '/'
|
|
}
|
|
},
|
|
'/mtwm/': {
|
|
// 新接口
|
|
target: 'https://waimaieapp.meituan.com',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/mtwm/': '/'
|
|
}
|
|
},
|
|
'/mtwm2/': {
|
|
// 新接口
|
|
target: 'http://e.waimai.meituan.com',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/mtwm2/': '/'
|
|
}
|
|
},
|
|
'/elem/': {
|
|
// 新接口
|
|
target: 'https://h5.ele.me/restapi/shopping/v3',
|
|
changeOrigin: true,
|
|
pathRewrite: {
|
|
'^/elem/': '/'
|
|
}
|
|
},
|
|
},
|
|
|
|
// Various Dev Server settings
|
|
host: 'localhost', // can be overwritten by process.env.HOST
|
|
port: 8085, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
|
autoOpenBrowser: false,
|
|
errorOverlay: true,
|
|
notifyOnErrors: true,
|
|
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
|
|
|
// Use Eslint Loader?
|
|
// If true, your code will be linted during bundling and
|
|
// linting errors and warnings will be shown in the console.
|
|
useEslint: true,
|
|
// If true, eslint errors and warnings will also be shown in the error overlay
|
|
// in the browser.
|
|
showEslintErrorsInOverlay: false,
|
|
|
|
/**
|
|
* Source Maps
|
|
*/
|
|
|
|
// https://webpack.js.org/configuration/devtool/#development
|
|
devtool: 'cheap-module-eval-source-map',
|
|
|
|
// If you have problems debugging vue-files in devtools,
|
|
// set this to false - it *may* help
|
|
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
|
cacheBusting: true,
|
|
|
|
cssSourceMap: true
|
|
},
|
|
|
|
build: {
|
|
// Template for index.html
|
|
index: path.resolve(__dirname, '../dist/alpha/index.html'),
|
|
|
|
// Paths
|
|
assetsRoot: path.resolve(__dirname, '../dist/alpha'),
|
|
assetsSubDirectory: 'static',
|
|
assetsPublicPath: '', //相对路径
|
|
|
|
/**
|
|
* Source Maps
|
|
*/
|
|
|
|
productionSourceMap: true,
|
|
// https://webpack.js.org/configuration/devtool/#production
|
|
devtool: '#source-map',
|
|
|
|
// 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
|
|
}
|
|
}
|