File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,19 @@ export class XtermAddon {
35
35
36
36
/**
37
37
* Dynamically imports the 'ligatures' addon from `@xterm/addon-ligatures`.
38
+ *
39
+ * This addon is designed to be used in environments with access to Node.js APIs (such as Electron).
40
+ *
38
41
* @returns A promise that resolves to the 'ligatures' addon module.
39
42
*/
40
- static LigaturesAddon = async ( ) => await import ( '@xterm/addon-ligatures' ) ;
43
+ static LigaturesAddon = async ( ) => {
44
+ if ( typeof process === 'undefined' || process . versions == null || process . versions . node == null ) {
45
+ // This is not a Node.js environment
46
+ throw new Error ( 'This module can only be imported in a Node.js environment' ) ;
47
+ }
48
+
49
+ return await import ( '@xterm/addon-ligatures' ) ;
50
+ }
41
51
42
52
/**
43
53
* Dynamically imports the 'search' addon from `@xterm/addon-search`.
You can’t perform that action at this time.
0 commit comments