'use strict' // Template version: 1.3.1 // see http://vuejs-templates.github.io/webpack for documentation. const path = require('path') module.exports = { // 网站模块名,例如 http://192.168.0.216:8089/module/app/initlayer.html 中的 //【views】,默认为views,修改这里的配置的同时,也要同时重命名/src/views的这个文件夹名称 // moduleName: 'xinsteel.ytg', // http://localhost:8081/#/views/user.html dev: { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', proxyTable: { '/ytg.pass.web/pass': { target: 'http://172.16.81.200:9001', // target: 'http://172.16.0.76:9001', //加http 测试服务器访问ip // target: 'http://6.6.6.6:9001', //加http ,正式服务器接口访问ip changeOrigin: true, pathRewrite: { '^/ytg.pass.web/pass': '/' //这里理解成用‘/api’代替target里面的地址,组件中我们调接口时直接用/api代替 // 比如我要调用'http://0.0:300/user/add',直接写‘/api/user/add’即可 代理后地址栏显示/ } }, '/icore-api': { target: 'http://172.16.0.76:9001', //加http changeOrigin: true, pathRewrite: { '^/icore-api': '/' //这里理解成用‘/api’代替target里面的地址,组件中我们调接口时直接用/api代替 // 比如我要调用'http://0.0:300/user/add',直接写‘/api/user/add’即可 代理后地址栏显示/ } }, '/xinsteel.maketx': { // target: 'http://172.16.0.76:8003', //加http // target: 'http://172.16.81.200:8007', //加http 测试正式环境,有分布式文件 // target: 'http://172.16.0.76', //加http5 // 本地连接正式环境用于测试: // target: 'http://172.16.81.200', // target: 'http://zhaolinzhi12.e2.luyouxia.net:20408', // target: 'http://6.6.6.6', // target: 'http://192.168.1.103:8080', // 老赵的本机服务ip target: 'http://127.0.0.1:8080', // 本地运行 // 本地 end changeOrigin: true, pathRewrite: { '^/xinsteel.maketx': '/xinsteel.maketx' //这里理解成用‘/api’代替target里面的地址,组件中我们调接口时直接用/api代替 // 比如我要调用'http://0.0:300/user/add',直接写‘/api/user/add’即可 代理后地址栏显示/ } }, // '/xinsteel.pass.web/service': { // target: 'http://172.16.0.76:8003/xinsteel.maketx/service', //加http // changeOrigin: true, // pathRewrite: { // '^/xinsteel.pass.web/service': '/' //这里理解成用‘/api’代替target里面的地址,组件中我们调接口时直接用/api代替 // // 比如我要调用'http://0.0:300/user/add',直接写‘/api/user/add’即可 代理后地址栏显示/ // } // } }, // Various Dev Server settings host: 'localhost', // can be overwritten by process.env.HOST port: 8802, // 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: false }, build: { // Template for index.html index: path.resolve(__dirname, '../dist/mes/index.html'), // Paths assetsRoot: path.resolve(__dirname, '../dist/mes'), assetsSubDirectory: 'static', // 打包后 static放的位置 assetsPublicPath: '../', // html中webpack打包的JS -> ../static/xxx.js /** * Source Maps */ productionSourceMap: false, // 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 } }