Shrink bundle size

A whole 30k... Changing Vue Material imports didn't change the vendor bundle at all; something still isn't right, but it's not a show-stopper
This commit is contained in:
Daniel J. Summers 2019-08-25 07:28:51 -05:00
parent 702ae1811c
commit 948f64c295
7 changed files with 59 additions and 30 deletions

View File

@ -30,6 +30,7 @@
"pug": "^2.0.1", "pug": "^2.0.1",
"pug-plain-loader": "^1.0.0", "pug-plain-loader": "^1.0.0",
"sass-loader": "^7.3.1", "sass-loader": "^7.3.1",
"vue-template-compiler": "^2.5.17" "vue-template-compiler": "^2.5.17",
"webpack-bundle-analyzer": "^3.4.1"
} }
} }

View File

@ -1,5 +1,5 @@
<template lang="pug"> <template lang="pug">
#app #app.page-container
md-app(md-waterfall md-mode='fixed-last' role='application') md-app(md-waterfall md-mode='fixed-last' role='application')
md-app-toolbar.md-large.md-dense.md-primary md-app-toolbar.md-large.md-dense.md-primary
.md-toolbar-row .md-toolbar-row
@ -16,8 +16,7 @@
md-snackbar(:md-active.sync='snackbar.visible' md-snackbar(:md-active.sync='snackbar.visible'
md-position='center' md-position='center'
:md-duration='snackbar.interval' :md-duration='snackbar.interval'
ref='snackbar') ref='snackbar') {{ snackbar.message }}
| {{ snackbar.message }}
footer footer
p.mpj-muted-text.mpj-text-right p.mpj-muted-text.mpj-text-right
| myPrayerJournal v{{ version }} | myPrayerJournal v{{ version }}

View File

@ -2,7 +2,23 @@
// Vue packages and components // Vue packages and components
import Vue from 'vue' import Vue from 'vue'
import VueMaterial from 'vue-material' import { MdApp,
MdButton,
MdCard,
MdContent,
MdDatepicker,
MdDialog,
MdEmptyState,
MdField,
MdIcon,
MdLayout,
MdProgress,
MdRadio,
MdSnackbar,
MdTable,
MdTabs,
MdToolbar,
MdTooltip } from 'vue-material/dist/components'
// myPrayerJournal components // myPrayerJournal components
import App from './App' import App from './App'
@ -19,7 +35,23 @@ import 'vue-material/dist/theme/default.css'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(VueMaterial) Vue.use(MdApp)
Vue.use(MdButton)
Vue.use(MdCard)
Vue.use(MdContent)
Vue.use(MdDatepicker)
Vue.use(MdDialog)
Vue.use(MdEmptyState)
Vue.use(MdField)
Vue.use(MdIcon)
Vue.use(MdLayout)
Vue.use(MdProgress)
Vue.use(MdRadio)
Vue.use(MdSnackbar)
Vue.use(MdTable)
Vue.use(MdTabs)
Vue.use(MdToolbar)
Vue.use(MdTooltip)
Vue.component('date-from-now', DateFromNow) Vue.component('date-from-now', DateFromNow)
Vue.component('page-title', PageTitle) Vue.component('page-title', PageTitle)

View File

@ -3,17 +3,7 @@
/* eslint-disable */ /* eslint-disable */
import Vue from 'vue' import Vue from 'vue'
import Router from 'vue-router' import Router from 'vue-router'
import ActiveRequests from '@/components/request/ActiveRequests'
import AnsweredRequests from '@/components/request/AnsweredRequests'
import EditRequest from '@/components/request/EditRequest'
import FullRequest from '@/components/request/FullRequest'
import Home from '@/components/Home' import Home from '@/components/Home'
import Journal from '@/components/Journal'
import LogOn from '@/components/user/LogOn'
import PrivacyPolicy from '@/components/legal/PrivacyPolicy'
import SnoozedRequests from '@/components/request/SnoozedRequests'
import TermsOfService from '@/components/legal/TermsOfService'
/* eslint-enable */ /* eslint-enable */
Vue.use(Router) Vue.use(Router)
@ -37,49 +27,49 @@ export default new Router({
{ {
path: '/journal', path: '/journal',
name: 'Journal', name: 'Journal',
component: Journal component: () => import('@/components/Journal')
}, },
{ {
path: '/legal/privacy-policy', path: '/legal/privacy-policy',
name: 'PrivacyPolicy', name: 'PrivacyPolicy',
component: PrivacyPolicy component: () => import('@/components/legal/PrivacyPolicy')
}, },
{ {
path: '/legal/terms-of-service', path: '/legal/terms-of-service',
name: 'TermsOfService', name: 'TermsOfService',
component: TermsOfService component: () => import('@/components/legal/TermsOfService')
}, },
{ {
path: '/request/:id/edit', path: '/request/:id/edit',
name: 'EditRequest', name: 'EditRequest',
component: EditRequest, component: () => import('@/components/request/EditRequest'),
props: true props: true
}, },
{ {
path: '/request/:id/full', path: '/request/:id/full',
name: 'FullRequest', name: 'FullRequest',
component: FullRequest, component: () => import('@/components/request/FullRequest'),
props: true props: true
}, },
{ {
path: '/requests/active', path: '/requests/active',
name: 'ActiveRequests', name: 'ActiveRequests',
component: ActiveRequests component: () => import('@/components/request/ActiveRequests')
}, },
{ {
path: '/requests/answered', path: '/requests/answered',
name: 'AnsweredRequests', name: 'AnsweredRequests',
component: AnsweredRequests component: () => import('@/components/request/AnsweredRequests')
}, },
{ {
path: '/requests/snoozed', path: '/requests/snoozed',
name: 'SnoozedRequests', name: 'SnoozedRequests',
component: SnoozedRequests component: () => import('@/components/request/SnoozedRequests')
}, },
{ {
path: '/user/log-on', path: '/user/log-on',
name: 'LogOn', name: 'LogOn',
component: LogOn component: () => import('@/components/user/LogOn')
} }
] ]
}) })

View File

@ -1,9 +1,16 @@
const webpack = require('webpack') const webpack = require('webpack')
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = { module.exports = {
outputDir: '../MyPrayerJournal.Api/wwwroot', outputDir: '../MyPrayerJournal.Api/wwwroot',
configureWebpack: { configureWebpack: {
plugins: [ plugins: [
// new BundleAnalyzerPlugin(),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/) new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
] ],
optimization: {
splitChunks: {
chunks: 'all'
}
}
} }
} }

View File

@ -8737,7 +8737,7 @@ wcwidth@^1.0.1:
dependencies: dependencies:
defaults "^1.0.3" defaults "^1.0.3"
webpack-bundle-analyzer@^3.3.0: webpack-bundle-analyzer@^3.3.0, webpack-bundle-analyzer@^3.4.1:
version "3.4.1" version "3.4.1"
resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.4.1.tgz#430544c7ba1631baccf673475ca8300cb74a3c47" resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.4.1.tgz#430544c7ba1631baccf673475ca8300cb74a3c47"
integrity sha512-Bs8D/1zF+17lhqj2OYmzi7HEVYqEVxu7lCO9Ff8BwajenOU0vAwEoV8e4ICCPNZAcqR1PCR/7o2SkW+cnCmF0A== integrity sha512-Bs8D/1zF+17lhqj2OYmzi7HEVYqEVxu7lCO9Ff8BwajenOU0vAwEoV8e4ICCPNZAcqR1PCR/7o2SkW+cnCmF0A==