460 Star 4.3K Fork 1.5K

Mr_HJ / form-generator

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 1.48 KB
一键复制 编辑 原始数据 按行查看 历史
Mr_HJ 提交于 2020-08-18 20:44 . feat: 级联组件动态获取数据
const path = require('path')
const minify = process.env.NODE_ENV === 'development' ? false : {
collapseWhitespace: true,
removeComments: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
useShortDoctype: true,
minifyCSS: true,
minifyJS: true
}
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = {
publicPath: process.env.NODE_ENV === 'production'
? '/form-generator/'
: '/',
pages: {
index: {
entry: 'src/views/index/main.js',
template: 'public/index.html',
filename: 'index.html',
chunks: ['chunk-vendors', 'chunk-common', 'index'],
minify
},
preview: {
entry: 'src/views/preview/main.js',
template: 'public/preview.html',
filename: 'preview.html',
chunks: ['chunk-vendors', 'chunk-common', 'preview'],
minify
}
},
devServer: {
overlay: false
},
productionSourceMap: false,
configureWebpack: {
externals: {
vue: 'Vue',
'vue-router': 'VueRouter',
'element-ui': 'ELEMENT'
}
},
chainWebpack(config) {
// set svg-sprite-loader
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()
}
}
JavaScript
1
https://gitee.com/mrhj/form-generator.git
git@gitee.com:mrhj/form-generator.git
mrhj
form-generator
form-generator
dev

搜索帮助