Skip to content

Commit 12287b4

Browse files
authored
fix(vidstack): rewrite CDN asset references (#1834)
1 parent 2fd2c8b commit 12287b4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/vidstack/tsdown.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ function rewriteCDNChunks(file: string): Plugin {
277277
for (const chunk of Object.values(bundle)) {
278278
if (chunk.type === 'chunk' && chunk.isEntry && chunk.name === file) {
279279
chunk.code = chunk.code.replace(
280-
/\"\.\/(chunks|providers)\/(.*?)\"/g,
281-
`"https://cdn.jsdelivr.net/npm/@vidstack/cdn@${version}/$1/$2"`,
280+
/(["'`])\.\/(chunks|providers)\/(.*?)\1/g,
281+
(_match, quote, dir, asset) =>
282+
`${quote}https://cdn.jsdelivr.net/npm/@vidstack/cdn@${version}/${dir}/${asset}${quote}`,
282283
);
283284
}
284285
}

0 commit comments

Comments
 (0)