Skip to content

Commit 21ec517

Browse files
authored
feat(module:code-editor): add global configuration to support monaco require config (#7121)
1 parent 4c669a5 commit 21ec517

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

components/code-editor/code-editor.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ export class NzCodeEditorService implements OnDestroy {
127127
const onLoad = (): void => {
128128
cleanup();
129129
windowAsAny.require.config({
130-
paths: { vs }
130+
paths: { vs },
131+
...this.config.extraConfig
131132
});
132133
windowAsAny.require(['vs/editor/editor.main'], () => {
133134
this.onLoad();

components/core/config/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export interface ButtonConfig {
110110

111111
export interface CodeEditorConfig {
112112
assetsRoot?: string | SafeUrl;
113+
extraConfig?: NzSafeAny;
113114
defaultEditorOption?: NzSafeAny;
114115
useStaticLoading?: boolean;
115116
monacoEnvironment?: Environment;

0 commit comments

Comments
 (0)