【webpack】config/index.js

 

// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')

module.exports = {
  build: {// 构建产品时使用的配置
    env: require('./prod.env'),// webpack的编译环境
    index: path.resolve(__dirname, '../dist/index.html'),// 编译输入的index.html文件
    assetsRoot: path.resolve(__dirname, '../dist'),// webpack输出的目标文件夹路径
    assetsSubDirectory: 'static',// webpack编译输出的二级文件夹
    assetsPublicPath: '/',// webpack编译输出的发布路径
    productionSourceMap: true,// 使用SourceMap
    // 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,// 默认不打开开启gzip模式
    productionGzipExtensions: ['js', 'css'],// gzip模式下需要压缩的文件的扩展名
    port: 9000
  },
  dev: {// 开发过程中使用的配置
    env: require('./dev.env'),// webpack的编译环境
    port: 8080,// dev-server监听的端口
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {},// 请求代理表,在这里可以配置特定的请求代理到对应的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  // 是否开启 cssSourceMap
  }
}

 

转载于:https://www.cnblogs.com/yujihang/p/7003098.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值