zoukankan      html  css  js  c++  java
  • 【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
      }
    }
  • 相关阅读:
    python初接触
    Visual Studio Code 必备插件
    C# 基础知识 -- 枚举(Enum)
    Visual Studio : Console.WriteLine(); 快捷键
    C# 调用Outlook发送邮件
    C# Dos、Unix、Mac文件格式之间的相互转换
    Treeview控件失去焦点,将选择的节点设置为高亮显示
    oracle中的Exists、In、Any、All
    TreeView控件如何控制滚动条的位置
    oracle 查看最大连接数与当前连接数
  • 原文地址:https://www.cnblogs.com/yujihang/p/7003098.html
Copyright © 2011-2022 走看看