1 Star 0 Fork 0

HePing/vue-form-builder

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vue.config.js 2.02 KB
一键复制 编辑 原始数据 按行查看 历史
HePing 提交于 2021-03-24 17:35 . .
const path = require('path')
const aliasConfig = require('./alias.config')
const port = process.env.port || 9000
function resolve(dir) {
return path.join(__dirname, dir)
}
const { VUE_APP_TITLE, VUE_APP_PROJECT_NAME } = process.env
function getPages() {
const pages = {
entry: 'src/main.js', // page 的入口
template: 'public/index.html', // 模板来源
filename: 'index.html', // 在 dist/index.html 的输出
// 当使用 title 选项时,
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
title: VUE_APP_TITLE,
// 在这个页面中包含的块,默认情况下会包含
// 提取出来的通用 chunk 和 vendor chunk。
chunks: ['chunk-vendors', 'chunk-common', 'index']
}
if (VUE_APP_PROJECT_NAME === 'default') {
return pages
} else if (VUE_APP_PROJECT_NAME === 'demo') {
return {
...pages,
entry: 'demo/main.js',
}
}
}
const CONFIG = {
pages: {
index: getPages()
},
// https://foo.github.io/bar/
// https://cli.vuejs.org/config/#publicpath
publicPath: '/',
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: false,
chainWebpack: config => {
config.module
.rule('svg')
.exclude.add(resolve('src/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
},
productionSourceMap: false,
configureWebpack: {
resolve: {
alias: {
...aliasConfig.resolve.alias
}
}
},
// 本地开发代理服务器
// https://github.com/chimurai/http-proxy-middleware
devServer: {
port: port,
// open: true,
overlay: {
warnings: false,
errors: true
},
proxy: {
'^/': {
target: process.env.VUE_APP_BASE_API_PROXY_URL,
ws: false,
changeOrigin: true
}
}
}
}
module.exports = CONFIG
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hepingmogul/vue-form-builder.git
git@gitee.com:hepingmogul/vue-form-builder.git
hepingmogul
vue-form-builder
vue-form-builder
dev

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385