mirror of
https://github.com/Ssl1S/json-schema-editor-vue.git
synced 2025-12-30 09:47:54 +08:00
⚡ ant-design按需引入,缩小包体积
This commit is contained in:
@@ -1,25 +1,28 @@
|
||||
const LodashModuleReplacementPlugin = require("lodash-webpack-plugin")
|
||||
const webpack = require('webpack')
|
||||
const path = require('path')
|
||||
module.exports = {
|
||||
publicPath: './',
|
||||
productionSourceMap: false,
|
||||
pages: {
|
||||
index: {
|
||||
entry: 'examples/main.js',
|
||||
template: 'public/index.html',
|
||||
filename: 'index.html'
|
||||
}
|
||||
},
|
||||
devServer: {
|
||||
// development server port 8000
|
||||
port: 8080
|
||||
}
|
||||
// css: {
|
||||
// loaderOptions: {
|
||||
// less: {
|
||||
// lessOptions: {
|
||||
// // important extra layer for less-loader^6.0.0
|
||||
// javascriptEnabled: true
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
publicPath: './',
|
||||
productionSourceMap: false,
|
||||
pages: {
|
||||
index: {
|
||||
entry: 'examples/main.js',
|
||||
template: 'public/index.html',
|
||||
filename: 'index.html'
|
||||
}
|
||||
},
|
||||
configureWebpack:{
|
||||
plugins: [
|
||||
new webpack.IgnorePlugin({
|
||||
resourceRegExp: /^\.\/locale$/,
|
||||
contextRegExp: /moment$/,
|
||||
}),
|
||||
]
|
||||
},
|
||||
chainWebpack(config) {
|
||||
if(process.env.analyzer) config.plugin('webpack-report').use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
|
||||
|
||||
config.plugin("loadshReplace").use(new LodashModuleReplacementPlugin())
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user