File tree
12 files changed
+406
-78
lines changed- scripts
- src
- actions/utils
- services
- dependencies
- workspace
- webview
- web-app
- public
12 files changed
+406
-78
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + |
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
32 |
| - | |
| 32 | + | |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
|
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
| |||
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
61 |
| - | |
| 61 | + | |
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 |
| |
19 | 21 |
| |
20 | 22 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
| 4 | + | |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
| 13 | + | |
13 | 14 |
| |
14 | 15 |
| |
15 | 16 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
| 4 | + | |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 |
| - | |
| 33 | + | |
| 34 | + | |
34 | 35 |
|
Lines changed: 6 additions & 11 deletions
@@ -20,23 +20,18 @@ async function render(panel: vscode.WebviewPanel, rootPath: string) {
20
20
21
21
// set base href
22
22
const base: HTMLBaseElement = document.createElement('base')
23
- base.href = `vscode-resource:${rootPath}/`
23
+ base.href = `${vscode.Uri.file(path.join(rootPath, 'build')).with({ scheme: 'vscode-resource' })}`
24
24
25
25
document.head.appendChild(base)
26
26
27
27
// used for CSP
28
28
const nonces: string[] = []
29
29
30
30
// generate vscode-resource build path uri
31
- const createUri = (filePath: string): any => {
32
- return (
33
- panel.webview
34
- // @ts-ignore
35
- .asWebviewUri(vscode.Uri.file(filePath))
36
- .toString()
37
- .replace(/^\/+/g, '') // remove leading '/'
38
- .replace('/vscode-resource%3A', rootPath)
39
- ) // replace mangled resource path with root
31
+ const createUri = (_filePath: string): any => {
32
+ const filePath = (_filePath.startsWith('vscode') ? _filePath.substr(16) : _filePath).replace('///', '\\')
33
+
34
+ return panel.webview.asWebviewUri(vscode.Uri.file(path.join(rootPath, filePath)))
40
35
}
41
36
42
37
// fix paths for scripts
@@ -55,7 +50,7 @@ async function render(panel: vscode.WebviewPanel, rootPath: string) {
55
50
runTimeScript.nonce = getNonce()
56
51
nonces.push(runTimeScript.nonce)
57
52
const manifest = await import(path.join(rootPath, 'asset-manifest.json'))
58
- runTimeScript.src = createUri(path.join(rootPath, manifest.files['runtime-main.js']))
53
+ runTimeScript.src = createUri(manifest.files['runtime-main.js'])
59
54
document.body.appendChild(runTimeScript)
60
55
61
56
// fix paths for links
0 commit comments