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 ...
随机推荐
- NLPIR
# coding: utf-8 import pynlpir from pynlpir import nlpir nlpir.Init(nlpir.PACKAGE_DIR, nlpir.UTF8_CO ...
- Codeforces 1099 C. Postcard-字符串处理(Codeforces Round #530 (Div. 2))
C. Postcard time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...
- CF #502
#include<cstdio> #include<string> #include<cstdlib> #include<cmath> #include ...
- RedisDesktopManager-0.9.3 for windows (转)
redis数据库的可视化工具 官方出了RedisDesktopManager-0.9.8版本后要购买了.之前自用的Windows版本0.9.3.817有需要的可以使用.解压直接启动即可.主要以备自用! ...
- 训练continue
11.16 树状数组 http://codeforces.com/contest/1070/problem/C digit sum+% dp http://codeforces.com/contest ...
- Java小对象的解决之道——对象池(Object Pool)的设计与应用
一.概述 面向对象编程是软件开发中的一项利器,现已经成为大多数编程人员的编程思路.很多高级计算机语言也对这种编程模式提供了很好的支持,例如C++.Object Pascal.Java等.曾经有大量的软 ...
- 【HDU 3622】Bomb Game
http://acm.hdu.edu.cn/showproblem.php?pid=3622 二分答案转化成2-sat问题. 上午测试时总想二分后把它转化成最大点独立集但是不会写最大点独立集暴力又秘制 ...
- 【bzoj1594】猜数游戏
1594: [Usaco2008 Jan]猜数游戏 Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 556 Solved: 225 Descripti ...
- 【转载】Java中String类的方法及说明
转载自:http://www.cnblogs.com/YSO1983/archive/2009/12/07/1618564.html String : 字符串类型 一. String sc_ ...
- pymysql与mysql各功能
pymysql # 增删改操作 import pymysql client=pymysql.connect( host='127.0.0.1', port=3306, user='root', pas ...