Skip to content

Commit

Permalink
Optimize webpack chunks
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Patil <[email protected]>
  • Loading branch information
pulsejet committed May 20, 2023
1 parent 2fe908a commit e9f447a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/comments/src/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
5 changes: 3 additions & 2 deletions apps/files_sharing/src/files_sharing_tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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() {
Expand All @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit e9f447a

Please sign in to comment.