Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3222de6

Browse files
committed
fix error on esbuild bundle
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parent3556ede commit3222de6

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

‎.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"coderoad",
1919
"esbuild",
2020
"flowtype",
21+
"fsevents",
2122
"outfile",
2223
"packagejson",
2324
"prismjs",

‎src/services/node/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { WORKSPACE_ROOT } from '../../environment'
66

77
constasyncExec=promisify(cpExec)
88
constasyncRemoveFile=promisify(fs.unlink)
9-
constasyncReadFile=promisify(fs.readFile)
9+
exportconstasyncReadFile=promisify(fs.readFile)
1010
constasyncWriteFile=promisify(fs.writeFile)
1111

1212
interfaceExecParams{

‎src/services/webview/render.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import{JSDOM}from'jsdom'
22
import*aspathfrom'path'
33
import*asvscodefrom'vscode'
4+
import{asyncReadFile}from'../node'
45
import{onError}from'../telemetry'
56
import{CONTENT_SECURITY_POLICY_EXEMPTIONS}from'../../environment'
67

@@ -64,7 +65,18 @@ async function render(panel: vscode.WebviewPanel, rootPath: string): Promise<voi
6465
construnTimeScript=document.createElement('script')
6566
runTimeScript.nonce=getNonce()
6667
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+
6880
runTimeScript.src=createUri(manifest.files['runtime-main.js'])
6981
document.body.appendChild(runTimeScript)
7082

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp