ci: fix source map missing pragma
This commit is contained in:
parent
abc3a66a33
commit
c1c1b287da
|
@ -17,12 +17,22 @@ export async function bundleCss(
|
||||||
try {
|
try {
|
||||||
const { code, map } = await builder({ filename, dev, assetDir })
|
const { code, map } = await builder({ filename, dev, assetDir })
|
||||||
|
|
||||||
await Deno.writeFile(join(assetDir, pathname), code)
|
|
||||||
if (map) {
|
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(
|
await Deno.writeFile(
|
||||||
join(assetDir, pathname.replace('.css', '.map.css')),
|
join(assetDir, pathname.replace('.css', '.map.css')),
|
||||||
map,
|
map,
|
||||||
)
|
)
|
||||||
|
} else {
|
||||||
|
await Deno.writeFile(join(assetDir, pathname), code)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.error('error during bundle, cleaning cache', error)
|
Logger.error('error during bundle, cleaning cache', error)
|
||||||
|
|
Loading…
Reference in a new issue