1 Star 0 Fork 47

helloworld/form-generator-antdv

forked from fuzui/form-generator-antdv 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vue.config.js 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
fuzui 提交于 2022-02-13 20:37 . init
const path = require('path')
const webpack = require('webpack')
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: '/',
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: {
plugins: [
// Ignore all locale files of moment.js
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment$/
})
],
externals: {
vue: 'Vue',
'vue-router': 'VueRouter',
vuex: 'Vuex',
'ant-design-vue': 'antd',
moment: 'moment'
}
},
chainWebpack(config) {
config.resolve.alias
.set('@$', resolve('src'))
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule
.oneOf('inline')
.resourceQuery(/inline/)
.use('vue-svg-icon-loader')
.loader('vue-svg-icon-loader')
.end()
.end()
.oneOf('external')
.use('file-loader')
.loader('file-loader')
.options({
name: 'assets/[name].[hash:8].[ext]'
})
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/easy-coding-style/form-generator-antdv.git
git@gitee.com:easy-coding-style/form-generator-antdv.git
easy-coding-style
form-generator-antdv
form-generator-antdv
master

搜索帮助