vue - config(index.js)
描述:我想,这是调用最多的一个文件了吧(无论是dev,还是prod)
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation. const path = require('path') module.exports = { /**
* 开发!!!
*/
dev: { // 路径
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {}, // 各种Dev Server设置
host: 'localhost', // 可以被process.env.HOST覆盖
port: 8080, // 可以被process.env.PORT覆盖,如果端口正在使用,将确定一个免费的端口(如果8080已被占用,将重新开启 8081... .一直到8080+n)
// 自动刷新浏览器
autoOpenBrowser: true,
// 错误覆盖
errorOverlay: true,
// 通知错误信息
notifyOnErrors: true,
// 轮询(减少服务器多个连接的压力)
poll: true, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- /**
* 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: true
}, /**
* 打包!!!
*/
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'), // 路径
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/', /**
* Source Maps
*/ productionSourceMap: true,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map', //默认情况下Gzip关闭许多流行的静态主机,例如
// Surge或Netlify已经为您准备了所有静态资产。
//在设置为“true”之前,请确保:
// npm install --save-dev compression-webpack-plugin // 是否开启Gzip压缩(日常服务器传输过来的文件大部分都是经过服务器Gzip处理过的,再由客户端进行一些处理)
productionGzip: false,
// Gzip压缩文件
productionGzipExtensions: ['js', 'css'], //运行带有额外参数的build命令
//在构建完成后查看捆绑分析器报告:
//`npm run build --report`
//设置为“true”或“false”以始终打开或关闭它
bundleAnalyzerReport: process.env.npm_config_report
}
}
vue - config(index.js)的更多相关文章
- vue -- config index.js 配置文件详解
此文章介绍vue-cli脚手架config目录下index.js配置文件 此配置文件是用来定义开发环境和生产环境中所需要的参数 关于注释 当涉及到较复杂的解释我将通过标识的方式(如(1))将解释写到单 ...
- vue中config/index.js:配置的详细理解
当我们需要和后台分离部署的时候,必须配置config/index.js: 用vue-cli 自动构建的目录里面 (环境变量及其基本变量的配置) var path = require('path') ...
- 对vue中 默认的 config/index.js:配置的详细理解 -【以及webpack配置的理解】-config配置的目的都是为了服务webpack的配置,给不同的编译条件提供配置
当我们需要和后台分离部署的时候,必须配置config/index.js: 用vue-cli 自动构建的目录里面 (环境变量及其基本变量的配置) var path = require('path') ...
- 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 ...
- vue-cli下面的config/index.js注解 webpack.base.conf.js注解
config/indexjs详解上代码: 'use strict' // Template version: 1.3.1 // see http://vuejs-templates.github.io ...
- webpack / vue项目 config/index.js配置(用于配置webpack服务器代理)
'use strict' // Template version: 1.1.3 // see http://vuejs-templates.github.io/webpack for document ...
- config/index.js
// see http://vuejs-templates.github.io/webpack for documentation.var path = require('path') module. ...
- vue-cli 构建项目中 config/index.js 文件解读
// see http://vuejs-templates.github.io/webpack for documentation. var path = require('path') module ...
- 【webpack】config/index.js
// see http://vuejs-templates.github.io/webpack for documentation. var path = require('path') module ...
随机推荐
- Linux下python版本的升级步骤
1.先下载,你要升级的python版本(我升级的是python3.3.0) 可使用系统自带下载工具wget下载: wget http://www.python.org/ftp/python/3.3.0 ...
- CodeForces 723E One-Way Reform
构造. 有一种十分巧妙的方法可以使图中所有度数为偶数的节点,经过每条边定向后,出度和入度都相等. 首先统计每个节点的度数,将度数为奇数的节点与编号为$n+1$的节点连边,这样一来,这张新图变成了每个节 ...
- go chapter 2 - read file(yaml)
func main() { data, err := ioutil.ReadFile("D:/test/widua.go") if err != nil { fmt.Println ...
- python 定义二维数组
1. myList = [([0] * n) for i in range(m)],n是列,m是行 >>> array=[([0]*3) for i in range(4)] > ...
- Luogu P3579 [POI2014]PAN-Solar Panels
题目大意: 给出T组询问,每组询问给出四个数a,b,c,d,每次询问满足a<=x<=b,c<=y<=d的gcd(x,y)的最大值 首先可以想到如果存在gcd(x,y)=k,那么 ...
- BZOJ 2430 [Poi2003]Chocolate(贪心+归并排序)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=2430 [题目大意] 有一块n*m的矩形巧克力,准备将它切成n*m块. 巧克力上共有n- ...
- 【高斯消元】CDOJ1785 曜酱的线性代数课堂(三)
高斯消元求行列式板子. #include<cstdio> #include<cmath> #include<algorithm> #include<cstri ...
- 【区间dp】【四边形不等式】CDOJ1653 最小生成树?
四边形不等式优化的资料去网上找下吧!很多. 可以证明,这个题里面,合并的代价满足较小区间+较大区间<=交错区间. 可以自己画个图看看. #include<cstdio> #inclu ...
- POJ 2079 Triangle(凸包+旋转卡壳,求最大三角形面积)
Triangle Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 7625 Accepted: 2234 Descript ...
- Java 8:不要再用循环了 Stream替代for循环
原文:http://www.importnew.com/14841.html 在这篇文章里,我们将会去了解传统循环的一些替代方案.在Java 8的新功能特性中,最棒的特性就是允许我们去表达我们想要完成 ...