Skip to content

Commit 8be3179

Browse files
Create devcontainer.json
LABEL org.opencontainers.image.source=https://github.com/OWNER/REPO
1 parent f6bab46 commit 8be3179

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/universal:2",
3+
"features": {}
4+
}import type { UserConfig } from 'vite'
5+
import path from 'node:path'
6+
// prettier-ignore
7+
const config: UserConfig = {
8+
// ---cut-before---
9+
experimental: {
10+
renderBuiltUrl(filename, { hostId, hostType, type }) {
11+
if (type === 'public') {
12+
return 'https://www.domain.com/' + filename
13+
} else if (path.extname(hostId) === '.js') {
14+
return {
15+
runtime: `window.__assetsPath(${JSON.stringify(filename)})`
16+
}
17+
} else {
18+
return 'https://cdn.domain.com/assets/' + filename
19+
}
20+
},
21+
},
22+
// ---cut-after---
23+
}experimental: {
24+
renderBuiltUrl(filename, { hostId, hostType, type }) {
25+
if (type === 'public') {
26+
return 'https://www.domain.com/' + filename
27+
} else if (path.extname(hostId) === '.js') {
28+
return {
29+
runtime: `window.__assetsPath(${JSON.stringify(filename)})`
30+
}
31+
} else {
32+
return 'https://cdn.domain.com/assets/' + filename
33+
}
34+
},
35+
},
36+
experimental: {
37+
renderBuiltUrl(filename, { hostType }) {
38+
if (hostType === 'js') {
39+
return { runtime: `window.__toCdnUrl(${JSON.stringify(filename)})` }
40+
} else {
41+
return { relative: true }
42+
}
43+
},
44+
},

0 commit comments

Comments
 (0)