private _getHtmlForWebview()

in src/extension/src/reactPanel.ts [90:120]


  private _getHtmlForWebview(): string {
    const manifest = require("../react/asset-manifest.json");
    const mainScript = manifest.files["main.js"];
    const mainStyle = manifest.files["main.css"];

    const scriptPathOnDisk = vscode.Uri.file(path.join(Controller.vsContext.extensionPath, "react", mainScript));

    const stylePathOnDisk = vscode.Uri.file(path.join(Controller.vsContext.extensionPath, "react", mainStyle));

    const basePathOnDisk = vscode.Uri.file(path.join(Controller.vsContext.extensionPath, "react"));

    return `<!DOCTYPE html>
			<html lang="en">
			<head>
				<meta charset="utf-8">
				<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
				<meta name="theme-color" content="#000000">
				<title>Web Template Studio</title>
				<link rel="stylesheet" type="text/css" href="${this._panel.webview.asWebviewUri(stylePathOnDisk)}">
				<meta img-src ${this._panel.webview.cspSource} https: ;style-src ${
      this._panel.webview.cspSource
    } 'unsafe-inline' http: https: data:;">
				<base href="${this._panel.webview.asWebviewUri(basePathOnDisk)}/">
			</head>
			<body>
				<noscript>You need to enable JavaScript to run this app.</noscript>
				<div id="root"></div>
        <script src="${this._panel.webview.asWebviewUri(scriptPathOnDisk)}"></script>
			</body>
			</html>`;
  }