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

module.exports = {
// 构建产品时使用的配置
build: {
// webpack的编译环境
env: require('./prod.env'),
// 编译输入的index.html文件
index: path.resolve(__dirname, '../dist/index.html'),
// webpack输出的目标文件夹路径
assetsRoot: path.resolve(__dirname, '../dist'),
// webpack编译输出的二级文件夹

assetsSubDirectory: 'static',
// webpack编译输出的发布路径
assetsPublicPath: '/',
// 使用SourceMap
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
// 默认不打开开启gzip模式

productionGzip: false,
// gzip模式下需要压缩的文件的扩展名
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: {

// webpack的编译环境
env: require('./dev.env'),
// dev-server监听的端口
port: 8080,
// 启动dev-server之后自动打开浏览器
autoOpenBrowser: true,
// webpack编译输出的二级文件夹
assetsSubDirectory: 'static',
// webpack编译输出的发布路径
assetsPublicPath: '/',
// 请求代理表,在这里可以配置特定的请求代理到对应的API接口
// 例如将'/api/xxx'代理到'www.example.com/api/xxx'

proxyTable: {},
// 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
cssSourceMap: false
}
}

config/index.js的更多相关文章

  1. vue-cli脚手架npm相关文件解读(9)config/index.js

    系列文章传送门: 1.build/webpack.base.conf.js 2.build/webpack.prod.conf.js 3.build/webpack.dev.conf.js 4.bui ...

  2. vue中config/index.js:配置的详细理解

    当我们需要和后台分离部署的时候,必须配置config/index.js: 用vue-cli 自动构建的目录里面  (环境变量及其基本变量的配置) var path = require('path') ...

  3. 对vue中 默认的 config/index.js:配置的详细理解 -【以及webpack配置的理解】-config配置的目的都是为了服务webpack的配置,给不同的编译条件提供配置

    当我们需要和后台分离部署的时候,必须配置config/index.js: 用vue-cli 自动构建的目录里面  (环境变量及其基本变量的配置) var path = require('path') ...

  4. vue-cli下面的config/index.js注解 webpack.base.conf.js注解

    config/indexjs详解上代码: 'use strict' // Template version: 1.3.1 // see http://vuejs-templates.github.io ...

  5. vue -- config index.js 配置文件详解

    此文章介绍vue-cli脚手架config目录下index.js配置文件 此配置文件是用来定义开发环境和生产环境中所需要的参数 关于注释 当涉及到较复杂的解释我将通过标识的方式(如(1))将解释写到单 ...

  6. vue-cli 构建项目中 config/index.js 文件解读

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

  7. webpack / vue项目 config/index.js配置(用于配置webpack服务器代理)

    'use strict' // Template version: 1.1.3 // see http://vuejs-templates.github.io/webpack for document ...

  8. 【webpack】config/index.js

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

  9. vue - config(index.js)

    描述:我想,这是调用最多的一个文件了吧(无论是dev,还是prod) 'use strict' // Template version: 1.3.1 // see http://vuejs-templ ...

随机推荐

  1. Delphi XE8 中TIdTCPClient的WriteLn编码变化!

    //XE2中正常的代码: IdTCPClient1.IOHandler.WriteLn(sendData,TEncoding.ANSI); //XE8中不行了,解决方法: //,引入“IdGlobal ...

  2. ARP欺骗与MITM(中间人攻击)实例

    ARP协议(address resolution protocol):地址解析协议 一台主机和另一台主机通信,要知道目标的IP地址,但是在局域网中传输数据的网卡却不能直接识别IP地址,所以用ARP解析 ...

  3. 30.SSH配置文件模板和类库.md

    目录 1.struts2 4.类库 1.struts2 1.<?xml version="1.0" encoding="UTF-8"?>2.< ...

  4. HTML+CSS基础课程

    慕课网上的课程 为了方便以后查阅 现做笔记如下 首先 了解下面的知识 1. HTML是网页内容的载体.内容就是网页制作者放在页面上想要让用户浏览的信息,可以包含文字.图片.视频等. 2. CSS样式是 ...

  5. 吴裕雄 05-mysql删除数据库

    drop database <数据库名>; 例如删除名为 RUNOOB 的数据库:drop database RUNOOB; 使用 mysqladmin 删除数据库你也可以使用 mysql ...

  6. Linux下怎么创建和进入带有空格的文件夹

    有时候需要创建带有空格的文件夹,虽然这不是一个好的习惯,但是偶尔会遇到.用的最多的是很多时候需要进入带有空格的文件夹,如"a b"是一个文件夹名. 创建:mkdir "a ...

  7. python 规范

    摘自google. https://i.cnblogs.com/PostDone.aspx?postid=9753605&actiontip=%E4%BF%9D%E5%AD%98%E4%BF% ...

  8. java课后作业总结

    今天的课后作业是做一个查找一段文章中单词出现的概率,统计并 输出出现概率最高的几个单词.拿到题目,老师还是往常一样提醒着我们先分析题目,构建大概的编程思路.程序需要遇到文本文件的输入输出操作,这一直一 ...

  9. package.json bin

    [package.json bin] 1.bin field in your package.json which is a map of command name to local file nam ...

  10. Dao层向sql语句传递多个参数

    手动封装: serviceImpl层 Map<String, Object> params = new HashMap<String, Object>(2);params.pu ...