Skip to content

Commit 56477f3

Browse files
committed
blobserve fix inline static replacements for code
1 parent 577b17e commit 56477f3

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

components/ide/code/leeway.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ RUN yarn --cwd extensions compile \
7979
RUN cp /vscode-web/out/vs/gitpod/browser/workbench/workbench.html /vscode-web/index.html \
8080
&& cp /vscode-web/out/vs/gitpod/browser/workbench/callback.html /vscode-web/callback.html \
8181
&& sed -i -e 's#baseUrl =.*;#baseUrl = window.location.origin;#g' /vscode-web/index.html \
82-
&& sed -i -e 's#{{WORKBENCH_WEB_BASE_URL}}#.#g' /vscode-web/index.html \
8382
&& sed -i -e "s/{{VERSION}}/$CODE_QUALITY-$CODE_COMMIT/g" /vscode-web/index.html
8483

8584
# cli config: alises to gitpod-code

install/installer/pkg/components/blobserve/configmap.go

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -74,22 +74,33 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
7474
Replacement: fmt.Sprintf("ide.%s/code/marketplace.json", ctx.Config.Domain),
7575
Path: "/ide/out/vs/workbench/workbench.web.main.js",
7676
}},
77-
InlineStatic: []blobserve.InlineReplacement{{
78-
Search: "${window.location.origin}",
79-
Replacement: ".",
80-
}, {
81-
Search: "value.startsWith(window.location.origin)",
82-
Replacement: "value.startsWith(window.location.origin) || value.startsWith('${ide}')",
83-
}, {
84-
Search: "./out",
85-
Replacement: "${ide}/out",
86-
}, {
87-
Search: "./node_modules",
88-
Replacement: "${ide}/node_modules",
89-
}, {
90-
Search: "/_supervisor/frontend",
91-
Replacement: "${supervisor}",
92-
}},
77+
InlineStatic: []blobserve.InlineReplacement{
78+
{
79+
Search: "const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();",
80+
Replacement: "const baseUrl = '${ide}';",
81+
},
82+
{
83+
Search: "{{WORKBENCH_WEB_BASE_URL}}",
84+
Replacement: "${ide}",
85+
}, {
86+
Search: "value.startsWith(window.location.origin)",
87+
Replacement: "value.startsWith(window.location.origin) || value.startsWith('${ide}')",
88+
}, {
89+
Search: "/_supervisor/frontend",
90+
Replacement: "${supervisor}",
91+
},
92+
// deprecated
93+
{
94+
Search: "${window.location.origin}",
95+
Replacement: ".",
96+
}, {
97+
Search: "./out",
98+
Replacement: "${ide}/out",
99+
}, {
100+
Search: "./node_modules",
101+
Replacement: "${ide}/node_modules",
102+
},
103+
},
93104
},
94105
ctx.RepoName(ctx.Config.Repository, workspace.SupervisorImage): {
95106
PrePull: []string{},

0 commit comments

Comments
 (0)