From 208d6e96f84da2d0947c19f341f171ddc015bf71 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Fri, 5 Jul 2024 12:00:05 -0700 Subject: [PATCH] Use esm image addon in demo --- bin/esbuild.mjs | 2 +- demo/client.ts | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/esbuild.mjs b/bin/esbuild.mjs index 6baf3d30..9360d5bb 100644 --- a/bin/esbuild.mjs +++ b/bin/esbuild.mjs @@ -150,7 +150,7 @@ if (config.isDemoClient) { "@xterm/addon-canvas": "./addons/addon-canvas/lib/xterm-addon-canvas.mjs", "@xterm/addon-clipboard": "./addons/addon-clipboard/lib/xterm-addon-clipboard.mjs", "@xterm/addon-fit": "./addons/addon-fit/lib/xterm-addon-fit.mjs", - // "@xterm/addon-image": "./addons/addon-image/lib/xterm-addon-image.js", + "@xterm/addon-image": "./addons/addon-image/lib/xterm-addon-image.mjs", // "@xterm/addon-ligatures": "./addons/addon-ligatures/lib/xterm-addon-ligatures.js", "@xterm/addon-search": "./addons/addon-search/lib/xterm-addon-search.mjs", "@xterm/addon-serialize": "./addons/addon-serialize/lib/xterm-addon-serialize.mjs", diff --git a/demo/client.ts b/demo/client.ts index c1404882..5aa961c6 100644 --- a/demo/client.ts +++ b/demo/client.ts @@ -8,15 +8,14 @@ /// -// TODO: Move to regular import? +// TODO: Move to regular import, currently it complains about the `fs` module import { LigaturesAddon } from '../addons/addon-ligatures/out-esbuild/LigaturesAddon'; -// DEBT: The image addon is not currently build with esbuild // HACK: Playwright/WebKit on Windows does not support WebAssembly https://stackoverflow.com/q/62311688/1156119 -import type { ImageAddonType, IImageAddonOptions } from '../addons/addon-image/out/ImageAddon'; -let ImageAddon: ImageAddonType | undefined; // eslint-disable-line @typescript-eslint/naming-convention +import type { ImageAddon as ImageAddonType, IImageAddonOptions } from '@xterm/addon-image'; +let ImageAddon: typeof ImageAddonType | undefined; // eslint-disable-line @typescript-eslint/naming-convention if ('WebAssembly' in window) { - const imageAddon = require('../addons/addon-image/out/ImageAddon'); + const imageAddon = require('@xterm/addon-image'); ImageAddon = imageAddon.ImageAddon; } @@ -25,7 +24,6 @@ import { AttachAddon } from '@xterm/addon-attach'; import { CanvasAddon } from '@xterm/addon-canvas'; import { ClipboardAddon } from '@xterm/addon-clipboard'; import { FitAddon } from '@xterm/addon-fit'; -// import { ImageAddon } from '@xterm/addon-image'; // import { LigaturesAddon } from '@xterm/addon-ligatures'; import { SearchAddon, ISearchOptions } from '@xterm/addon-search'; import { SerializeAddon } from '@xterm/addon-serialize';