Browse Source

fix: theme loading optimizations

pull/1783/head
NGPixel 4 years ago
parent
commit
c9e7811c55
3 changed files with 14 additions and 16 deletions
  1. 13
      client/client-app.js
  2. 13
      client/index-app.js
  3. 4
      client/index-setup.js

13
client/client-app.js

@ -168,9 +168,9 @@ Vue.component('unauthorized', () => import(/* webpackChunkName: "unauthorized" *
Vue.component('v-card-chin', () => import(/* webpackPrefetch: true, webpackChunkName: "ui-extra" */ './components/common/v-card-chin.vue'))
Vue.component('welcome', () => import(/* webpackChunkName: "welcome" */ './components/welcome.vue'))
Vue.component('nav-footer', () => import(/* webpackChunkName: "theme-page" */ './themes/' + process.env.CURRENT_THEME + '/components/nav-footer.vue'))
Vue.component('nav-sidebar', () => import(/* webpackChunkName: "theme-page" */ './themes/' + process.env.CURRENT_THEME + '/components/nav-sidebar.vue'))
Vue.component('page', () => import(/* webpackChunkName: "theme-page" */ './themes/' + process.env.CURRENT_THEME + '/components/page.vue'))
Vue.component('nav-footer', () => import(/* webpackChunkName: "theme" */ './themes/' + siteConfig.theme + '/components/nav-footer.vue'))
Vue.component('nav-sidebar', () => import(/* webpackChunkName: "theme" */ './themes/' + siteConfig.theme + '/components/nav-sidebar.vue'))
Vue.component('page', () => import(/* webpackChunkName: "theme" */ './themes/' + siteConfig.theme + '/components/page.vue'))
let bootstrap = () => {
// ====================================
@ -210,13 +210,6 @@ let bootstrap = () => {
// ----------------------------------
window.boot.notify('vue')
// ====================================
// Load theme-specific code
// ====================================
// eslint-disable-next-line no-unused-expressions
import(/* webpackChunkName: "theme-page" */ './themes/' + process.env.CURRENT_THEME + '/js/app.js')
}
window.boot.onDOMReady(bootstrap)

13
client/index-app.js

@ -1,21 +1,24 @@
require('core-js/stable')
require('regenerator-runtime/runtime')
/* global siteConfig */
/* eslint-disable no-unused-expressions */
switch (window.document.documentElement.lang) {
case 'ar':
case 'fa':
require('./scss/fonts/arabic.scss')
import(/* webpackChunkName: "fonts-arabic" */ './scss/fonts/arabic.scss')
break
default:
require('./scss/fonts/default.scss')
import(/* webpackChunkName: "fonts-default" */ './scss/fonts/default.scss')
break
}
require('./scss/app.scss')
require('./themes/' + process.env.CURRENT_THEME + '/scss/app.scss')
import(/* webpackChunkName: "theme" */ './themes/' + siteConfig.theme + '/scss/app.scss')
require('@mdi/font/css/materialdesignicons.css')
import(/* webpackChunkName: "mdi" */ '@mdi/font/css/materialdesignicons.css')
require('./helpers/compatibility.js')
require('./client-app.js')
require('./themes/' + process.env.CURRENT_THEME + '/js/app.js')
import(/* webpackChunkName: "theme" */ './themes/' + siteConfig.theme + '/js/app.js')

4
client/index-setup.js

@ -1,8 +1,10 @@
require('core-js/stable')
require('regenerator-runtime/runtime')
/* eslint-disable no-unused-expressions */
require('./scss/app.scss')
require('@mdi/font/css/materialdesignicons.css')
import(/* webpackChunkName: "mdi" */ '@mdi/font/css/materialdesignicons.css')
require('./helpers/compatibility.js')

Loading…
Cancel
Save