vue的config文件夹里的index.js详解
来源:互联网 发布:微信淘宝推广怎么做的 编辑:程序博客网 时间:2024/06/08 12:16
var path = require('path')
module.exports = {
build: { // production 环境
env: require('./prod.env'), // 使用 config/prod.env.js 中定义的编译环境
index: path.resolve(__dirname, '../dist/index.html'), // 编译输入的 index.html 文件
assetsRoot: path.resolve(__dirname, '../dist'), // 编译输出的静态资源路径
assetsSubDirectory: 'static', // 编译输出的二级目录
assetsPublicPath: '/', // 编译发布的根目录,可配置为资源服务器域名或 CDN 域名
productionSourceMap: true, // 是否开启 cssSourceMap
// 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 压缩的文件扩展名
},
dev: { // dev 环境
env: require('./dev.env'), // 使用 config/dev.env.js 中定义的编译环境
port: 8080, // 运行测试页面的端口
assetsSubDirectory: 'static', // 编译输出的二级目录
assetsPublicPath: '/', // 编译发布的根目录,可配置为资源服务器域名或 CDN 域名
proxyTable: {}, // 需要 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: false // 是否开启 cssSourceMap
}
}
module.exports = {
build: { // production 环境
env: require('./prod.env'), // 使用 config/prod.env.js 中定义的编译环境
index: path.resolve(__dirname, '../dist/index.html'), // 编译输入的 index.html 文件
assetsRoot: path.resolve(__dirname, '../dist'), // 编译输出的静态资源路径
assetsSubDirectory: 'static', // 编译输出的二级目录
assetsPublicPath: '/', // 编译发布的根目录,可配置为资源服务器域名或 CDN 域名
productionSourceMap: true, // 是否开启 cssSourceMap
// 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 压缩的文件扩展名
},
dev: { // dev 环境
env: require('./dev.env'), // 使用 config/dev.env.js 中定义的编译环境
port: 8080, // 运行测试页面的端口
assetsSubDirectory: 'static', // 编译输出的二级目录
assetsPublicPath: '/', // 编译发布的根目录,可配置为资源服务器域名或 CDN 域名
proxyTable: {}, // 需要 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: false // 是否开启 cssSourceMap
}
}
阅读全文
0 0
- vue的config文件夹里的index.js详解
- vue中config/index.js:配置的详细理解
- 对vue中 默认的 config/index.js:配置的详细理解 -【以及webpack配置的理解】
- vue2.0 使用vue-cli搭建的项目如何在index.html里引入静态css和js
- vue-cli脚手架config目录下index.js配置文件
- 对vue中 默认的 config/index.js:配置的详细理解 -【以及webpack配置的理解】-config配置的目的都是为了服务webpack的配置,给不同的编译条件提供配置
- 对vue中 默认的 config/index.js:配置的详细理解 -【以及webpack配置的理解】-config配置的目的都是为了服务webpack的配置,给不同的编译条件提供配置
- React中文件夹中Index.js的作用
- vue开发:详解vue.js的devtools安装
- 详解vue.js的devtools安装
- vue中main.js 里的/* eslint-disable no-new */
- 17、vue.js 之路由里的返回、前进、跳转
- vue-cli的webpack模版,相关配置文件dev-server.js与webpack.config.js配置解析
- 请问,为什么我直接在地址栏里输入文件夹,却不会自动跳转到文件夹下默认的index.html
- web.config 里的经验
- vue 的 函数引入 index 问题
- vue的“$index” is undefined错误
- 去掉vue里的分号
- PAT1113 求数集合之差
- mysql api编程(一)
- 基于C#的WinForm窗体美化(无须美工功底)
- 截屏并去掉状态栏
- mybatis自动生成工具
- vue的config文件夹里的index.js详解
- TCP/IP四层模型
- ssh 公钥私钥认证原理
- org.hibernate.AnnotationException: Associations marked as mappedBy must not define database mappings
- 【Linux】模拟实现sleep函数
- 远程主机强迫关闭了一个现有的连接
- Innodb中的事务隔离级别和锁的关系
- mybatis 开发中遇到的问题(一)
- react-表单