diff --git a/src/editor.js b/src/editor.js index c61643f089f..7e7258bccea 100644 --- a/src/editor.js +++ b/src/editor.js @@ -4,7 +4,7 @@ */ import { emit, subscribe } from '@nextcloud/event-bus' -import Vue from 'vue' +import Vue, { defineAsyncComponent } from 'vue' import { ATTACHMENT_RESOLVER, EDITOR_UPLOAD, @@ -265,8 +265,8 @@ window.OCA.Text.createEditor = async function ({ onSearch = undefined, onAttachmentsUpdated = ({ attachmentSrcs }) => {}, }) { - const { default: MarkdownContentEditor } = await import( - './components/Editor/MarkdownContentEditor.vue' + const MarkdownContentEditor = defineAsyncComponent( + () => import('./components/Editor/MarkdownContentEditor.vue'), ) const { default: Editor } = await import('./components/Editor.vue') @@ -365,8 +365,8 @@ window.OCA.Text.createTable = async function ({ onLoaded = () => {}, onUpdate = ({ markdown }) => {}, }) { - const { default: PlainTableContentEditor } = await import( - './components/Editor/PlainTableContentEditor.vue' + const PlainTableContentEditor = defineAsyncComponent( + () => import('./components/Editor/PlainTableContentEditor.vue'), ) const data = Vue.observable({