mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-20 16:43:53 +01:00
Fix build
This commit is contained in:
@@ -92,11 +92,8 @@ export function Editor({
|
||||
|
||||
useEffect(() => {
|
||||
if (cm.current === null) return;
|
||||
const { view, languageCompartment } = cm.current;
|
||||
const newDoc = defaultValue;
|
||||
view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: newDoc ?? '' } });
|
||||
const ext = getLanguageExtension({ contentType, useTemplating, autocomplete });
|
||||
view.dispatch({ effects: languageCompartment.reconfigure(ext) });
|
||||
const { view } = cm.current;
|
||||
view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: defaultValue ?? '' } });
|
||||
}, [forceUpdateKey]);
|
||||
|
||||
// Initialize the editor when ref mounts
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { memo } from 'react';
|
||||
import * as editor from './Editor';
|
||||
|
||||
export type { EditorProps } from './Editor';
|
||||
const editor = await import('./Editor');
|
||||
// TODO: Figure out why code-splitting breaks production build from
|
||||
// showing any content
|
||||
// const editor = await import('./Editor');
|
||||
|
||||
export const Editor = memo(editor.Editor);
|
||||
export const graphql = editor.graphql;
|
||||
|
||||
Reference in New Issue
Block a user