|
1 | 1 | import{JSDOM}from'jsdom'
|
2 | 2 | import*aspathfrom'path'
|
3 | 3 | import*asvscodefrom'vscode'
|
| 4 | +import{asyncReadFile}from'../node' |
4 | 5 | import{onError}from'../telemetry'
|
5 | 6 | import{CONTENT_SECURITY_POLICY_EXEMPTIONS}from'../../environment'
|
6 | 7 |
|
@@ -64,7 +65,18 @@ async function render(panel: vscode.WebviewPanel, rootPath: string): Promise<voi
|
64 | 65 | construnTimeScript=document.createElement('script')
|
65 | 66 | runTimeScript.nonce=getNonce()
|
66 | 67 | nonces.push(runTimeScript.nonce)
|
67 |
| -constmanifest=awaitimport(path.join(rootPath,'asset-manifest.json')) |
| 68 | + |
| 69 | +// note: file cannot be imported or results in esbuild error. Easier to read it. |
| 70 | +letmanifest |
| 71 | +try{ |
| 72 | +constmanifestPath=path.join(rootPath,'asset-manifest.json') |
| 73 | +console.log(manifestPath) |
| 74 | +constmanifestFile=awaitasyncReadFile(manifestPath,'utf8') |
| 75 | +manifest=JSON.parse(manifestFile) |
| 76 | +}catch(e){ |
| 77 | +thrownewError('Failed to read manifest file') |
| 78 | +} |
| 79 | + |
68 | 80 | runTimeScript.src=createUri(manifest.files['runtime-main.js'])
|
69 | 81 | document.body.appendChild(runTimeScript)
|
70 | 82 |
|
|