博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
webpack / vue项目 config/index.js配置(用于配置webpack服务器代理)
阅读量:5732 次
发布时间:2019-06-18

本文共 1707 字,大约阅读时间需要 5 分钟。

'use strict'// Template version: 1.1.3// see http://vuejs-templates.github.io/webpack for documentation.const path = require('path')module.exports = {  build: {    env: require('./prod.env'),    index: path.resolve(__dirname, '../dist/index.html'),    assetsRoot: path.resolve(__dirname, '../dist'),    assetsSubDirectory: 'static',    assetsPublicPath: '/',    productionSourceMap: true,    // 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: {    env: require('./dev.env'),    port: process.env.PORT || 8080,    autoOpenBrowser: true,    assetsSubDirectory: 'static',    assetsPublicPath: '/',    proxyTable: {      '/api': {        //target: 'http://www.el56.com/api',        target:'http://web.com:10001/api',        changeOrigin: true,        pathRewrite: {          '^/api': '/'        }      }    },    // 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  }}

  

转载于:https://www.cnblogs.com/web-aqin/p/9878461.html

你可能感兴趣的文章
EL表达式无法显示Model中的数据
查看>>
Linux应用小技巧
查看>>
考题纠错2
查看>>
ps6-工具的基础使用
查看>>
关于CefSharp.WinForms的学习
查看>>
灵活运用 SQL SERVER FOR XML PATH
查看>>
es 加磁盘扩容
查看>>
linux 参数内核
查看>>
使用Azcopy在Azure上进行HBase的冷热备份还原
查看>>
计组_定点数一位乘_布斯公式
查看>>
linux下使用过的命令总结(未整理完)
查看>>
ES6的一些文章
查看>>
LeetCode 198, 213 House Robber
查看>>
New Year Permutation(Floyd+并查集)
查看>>
Qt编写输入法V2018超级终结版
查看>>
<context:component-scan>详解
查看>>
DS博客作业07--查找
查看>>
[JOI2017] サッカー (Soccer)
查看>>
Git 方法
查看>>
[Python] numpy.nonzero
查看>>