Commit d3720ca0 authored by NGPixel's avatar NGPixel

refactor: added bundle analyzer

parent 1c8f3e4b
......@@ -8,6 +8,7 @@
"stop": "node wiki stop",
"restart": "node wiki restart",
"build": "poi build",
"build:analyze": "poi build --analyze",
"dev:client": "poi watch",
"dev:server": "nodemon",
"dev:server:alt": "node-dev server --no-deps --respawn --no-notify",
......@@ -190,6 +191,7 @@
"vue-template-es2015-compiler": "1.6.0",
"vuex": "3.0.1",
"vuex-persistedstate": "2.4.2",
"webpack-bundle-analyzer": "2.9.2",
"whatwg-fetch": "2.0.3"
},
"jest": {
......
const path = require('path')
const _ = require('lodash')
const SpriteLoaderPlugin = require('svg-sprite-loader/plugin')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
// const _ = require('lodash')
// const SpriteLoaderPlugin = require('svg-sprite-loader/plugin')
module.exports = {
module.exports = options => ({
entry: 'client/index.js',
dist: 'assets',
staticFolder: 'client/static',
......@@ -27,7 +28,7 @@ module.exports = {
},
html: false,
hash: false,
sourceMap: true,
sourceMap: false,
extendWebpack (config) {
// Vue - Default SCSS Imports
config.module.rule('vue')
......@@ -68,8 +69,15 @@ module.exports = {
// Vue with Compiler Alias
config.resolve.alias.set('vue$', 'vue/dist/vue.common.js')
// Bundle Analyze
if (options.analyze) {
config.plugin('analyzer').use(BundleAnalyzerPlugin, [{
analyzerMode: 'static'
}])
}
},
webpack (config) {
return config
}
}
})
This diff was suppressed by a .gitattributes entry.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment