[ci] format
This commit is contained in:
parent
fbef6a7f72
commit
8b468ccccc
2 changed files with 15 additions and 13 deletions
|
@ -179,25 +179,25 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu
|
||||||
code: '',
|
code: '',
|
||||||
meta: {
|
meta: {
|
||||||
vite: {
|
vite: {
|
||||||
lang: 'ts'
|
lang: 'ts',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (hoistedScript.type) {
|
switch (hoistedScript.type) {
|
||||||
case 'inline': {
|
case 'inline': {
|
||||||
let { code, map } = hoistedScript
|
let { code, map } = hoistedScript;
|
||||||
result.code = appendSourceMap(code, map);
|
result.code = appendSourceMap(code, map);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'external': {
|
case 'external': {
|
||||||
const { src } = hoistedScript
|
const { src } = hoistedScript;
|
||||||
result.code = `import "${src}"`;
|
result.code = `import "${src}"`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
|
@ -364,5 +364,7 @@ ${source}
|
||||||
|
|
||||||
function appendSourceMap(content: string, map?: string) {
|
function appendSourceMap(content: string, map?: string) {
|
||||||
if (!map) return content;
|
if (!map) return content;
|
||||||
return `${content}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${Buffer.from(map).toString('base64')}`
|
return `${content}\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${Buffer.from(
|
||||||
|
map
|
||||||
|
).toString('base64')}`;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue