config/index.js
// 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的更多相关文章
- 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中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下面的config/index.js注解 webpack.base.conf.js注解
config/indexjs详解上代码: 'use strict' // Template version: 1.3.1 // see http://vuejs-templates.github.io ...
- vue -- config index.js 配置文件详解
此文章介绍vue-cli脚手架config目录下index.js配置文件 此配置文件是用来定义开发环境和生产环境中所需要的参数 关于注释 当涉及到较复杂的解释我将通过标识的方式(如(1))将解释写到单 ...
- vue-cli 构建项目中 config/index.js 文件解读
// see http://vuejs-templates.github.io/webpack for documentation. var path = require('path') module ...
- webpack / vue项目 config/index.js配置(用于配置webpack服务器代理)
'use strict' // Template version: 1.1.3 // see http://vuejs-templates.github.io/webpack for document ...
- 【webpack】config/index.js
// see http://vuejs-templates.github.io/webpack for documentation. var path = require('path') module ...
- vue - config(index.js)
描述:我想,这是调用最多的一个文件了吧(无论是dev,还是prod) 'use strict' // Template version: 1.3.1 // see http://vuejs-templ ...
随机推荐
- 30.SSH配置文件模板和类库.md
目录 1.struts2 4.类库 1.struts2 1.<?xml version="1.0" encoding="UTF-8"?>2.< ...
- Java复习 之容器
小生快要准备找工作了 现在开始复习一下Java基础之容器 Set和List是一个个往里面存 Map是两个两个往里面装 所谓重复指的是他们互相equals Collection 接口定义了存取一组对象的 ...
- javascript 中Array.prototype.sort 函数的用法
来源:http://www.jb51.net/article/5769.htm JavaScript中对变量的操作都是通过引用方式,而对数组也一样. 前两天想要对一个数组进行复制,一直苦于找不到办法( ...
- 3dmax快捷键
P 透视图 F前视图 L 左视图 T 顶视图 B 底视图单窗口与四窗口的切换快捷键是 alt+w 渲染快捷键 shilf+q 独立 快捷键 alt+q 自己多记点快捷键哦!!!!3DMAX2009快捷 ...
- 将一个dropdownlist从一个div复制到另一个div
<select id="dropdwon1"> <option value=">Item1</option> <option v ...
- 关于 uboot 的异常向量表
ldr r,address 表示将 address 地址中的内容存入 r0 中
- 用JS和JQ来获取子节点!
用JS和JQ来获取子节点! 在JS中,如果通过document.getElementsByTagName来获取子元素有个弊端:它不单会获取符合要求的子元素,就连同孙元素也会获取.如果有特殊要求,那 ...
- Python算法(一)冒泡排序
3 5 1 6 2 1)第一次:找到这些数中最大的一个,并把它放最后. 3.5找到大的数放到第二个位置 5.1找到大的数放到第三个位置 5.6找到大的数放到第四个位置 2.6找到大的数放大第五个位置 ...
- ubuntu下安装nodejs和npm
第一种安装方法: 安装nodejs : 1 sudo apt-get install nodejs 运行 nodejs -v 会弹出安装node的版本号 这里使用的是 nodejs 并不是常用的nod ...
- chrome 扩展 调试
开发chrome扩展,有时候需要输出console.log 通常调试的popup.html.content_script.backgroup.html等 但是有一些是没有这些的 1.推荐一个扩展: h ...