ci: fix source map missing pragma
This commit is contained in:
parent
abc3a66a33
commit
c1c1b287da
|
@ -17,12 +17,22 @@ export async function bundleCss(
|
|||
try {
|
||||
const { code, map } = await builder({ filename, dev, assetDir })
|
||||
|
||||
await Deno.writeFile(join(assetDir, pathname), code)
|
||||
if (map) {
|
||||
//# sourceMappingURL=fresh_dev_client.js.map
|
||||
const sourceMappingURL = new TextEncoder().encode(
|
||||
`\n/*# sourceMappingURL=${pathname.replace('.css', '.map.css')} */`,
|
||||
)
|
||||
await Deno.writeFile(
|
||||
join(assetDir, pathname),
|
||||
Uint8Array.of(...code, ...sourceMappingURL),
|
||||
)
|
||||
|
||||
await Deno.writeFile(
|
||||
join(assetDir, pathname.replace('.css', '.map.css')),
|
||||
map,
|
||||
)
|
||||
} else {
|
||||
await Deno.writeFile(join(assetDir, pathname), code)
|
||||
}
|
||||
} catch (error) {
|
||||
Logger.error('error during bundle, cleaning cache', error)
|
||||
|
|
Loading…
Reference in a new issue