Optimize webpack chunks

Signed-off-by: Varun Patil <varunpatil@ucla.edu>
This commit is contained in:
Varun Patil 2023-05-16 16:22:15 -07:00 committed by Daniel Kesselberg
parent 66a8a9fba1
commit 48e1a58345
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
3 changed files with 5 additions and 4 deletions

View File

@ -110,7 +110,7 @@ import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionSeparator from '@nextcloud/vue/dist/Components/NcActionSeparator.js'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcRichContenteditable from '@nextcloud/vue/dist/Components/NcRichContenteditable.js'
const NcRichContenteditable = () => import('@nextcloud/vue/dist/Components/NcRichContenteditable')
import RichEditorMixin from '@nextcloud/vue/dist/Mixins/richEditor.js'
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'

View File

@ -24,7 +24,6 @@
import Vue from 'vue'
import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import SharingTab from './views/SharingTab.vue'
import ShareSearch from './services/ShareSearch.js'
import ExternalLinkActions from './services/ExternalLinkActions.js'
import ExternalShareActions from './services/ExternalShareActions.js'
@ -46,7 +45,6 @@ Vue.prototype.t = t
Vue.prototype.n = n
// Init Sharing tab component
const View = Vue.extend(SharingTab)
let TabInstance = null
window.addEventListener('DOMContentLoaded', function() {
@ -57,6 +55,9 @@ window.addEventListener('DOMContentLoaded', function() {
iconSvg: ShareVariant,
async mount(el, fileInfo, context) {
const SharingTab = (await import('./views/SharingTab.vue')).default
const View = Vue.extend(SharingTab)
if (TabInstance) {
TabInstance.$destroy()
}

View File

@ -143,11 +143,11 @@ module.exports = {
optimization: {
splitChunks: {
automaticNameDelimiter: '-',
minChunks: 3, // minimum number of chunks that must share the module
cacheGroups: {
vendors: {
// split every dependency into one bundle
test: /[\\/]node_modules[\\/]/,
enforce: true,
// necessary to keep this name to properly inject it
// see OC_Template.php
name: 'core-common',