Skip to content

Commit

Permalink
avoid "require is not defined" error when previewing HTML file
Browse files Browse the repository at this point in the history
  • Loading branch information
sharon-wang committed Dec 19, 2024
1 parent ff31136 commit 3eb662a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { IExtHostWorkspace } from '../extHostWorkspace.js';
import type * as vscode from 'vscode';
import type * as positron from 'positron';
import * as extHostProtocol from './extHost.positron.protocol.js';
import * as path from '../../../../base/common/path.js';

type IconPath = URI | { readonly light: URI; readonly dark: URI };

Expand Down Expand Up @@ -242,7 +243,6 @@ export class ExtHostPreviewPanels implements extHostProtocol.ExtHostPreviewPanel
};
this._proxy.$previewHtml(toExtensionData(extension), handle, htmlpath);
const webview = this.webviews.$createNewWebview(handle, options, extension);
const path = require('path');
const title = path.basename(htmlpath);
const panel = this.createNewPreviewPanel(handle, viewType, title, webview as ExtHostWebview, true);

Expand Down

0 comments on commit 3eb662a

Please sign in to comment.