1 Star 0 Fork 0

SpellbindingCircle / Example

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
liuxin 提交于 2021-09-08 15:01 . 时间轴工具升级
const webpack = require('webpack')
module.exports = {
//部署应用包时的基本 URL
publicPath: '/',
//当运行 vue-cli-service build 时生成的生产环境构建文件的目录
outputDir: 'dist',
//放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录
assetsDir: 'static',
// eslint-loader 是否在保存的时候检查 安装@vue/cli-plugin-eslint有效
lintOnSave: false,
//是否使用包含运行时编译器的 Vue 构建版本。设置true后你就可以在使用template
runtimeCompiler: true,
// 生产环境是否生成 sourceMap 文件 sourceMap的详解请看末尾
productionSourceMap: true,
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
// 为生产环境修改配置...
} else {
// 为开发环境修改配置...
}
},
// css相关配置
css: {
// 是否使用css分离插件 ExtractTextPlugin 生产环境下是true,开发环境下是false
extract: true,
// 开启 CSS source maps?
sourceMap: false,
// css预设器配置项
loaderOptions: {},
// 启用 CSS modules for all css / pre-processor files.
requireModuleExtension: false
},
// webpack-dev-server 相关配置
devServer: { // 设置代理
hot: true, //热加载
// host: '0.0.0.0', //ip地址
// port: 8085, //端口
https: false, //false关闭https,true为开启
open: true, //自动打开浏览器
// proxy: {
// // '/': { //本地
// // target: 'http://8.129.46.241:3004',
// // // 如果要代理 websockets
// // ws: true,
// // changeOrigin: true
// // },
// // '/test': { //测试
// // target: 'xxx'
// // },
// // '/pre': { //预发布
// // target: 'xxx'
// // },
// // '/pro': { //正式
// // target: 'xxx'
// // }
// }
},
pluginOptions: { // 第三方插件配置
}
}
JavaScript
1
https://gitee.com/spellbindingcircle/example.git
git@gitee.com:spellbindingcircle/example.git
spellbindingcircle
example
Example
master

搜索帮助