[ci] format
This commit is contained in:
parent
d55658f061
commit
76f6643ddd
1 changed files with 4 additions and 2 deletions
|
@ -63,7 +63,7 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu
|
||||||
const { query: fromQuery, filename } = parseAstroRequest(from);
|
const { query: fromQuery, filename } = parseAstroRequest(from);
|
||||||
if (fromQuery.astro && isRelativePath(id) && fromQuery.type === 'script') {
|
if (fromQuery.astro && isRelativePath(id) && fromQuery.type === 'script') {
|
||||||
const resolvedURL = new URL(id, `file://${filename}`);
|
const resolvedURL = new URL(id, `file://${filename}`);
|
||||||
const resolved = resolvedURL.pathname
|
const resolved = resolvedURL.pathname;
|
||||||
if (isBrowserPath(resolved)) {
|
if (isBrowserPath(resolved)) {
|
||||||
return relativeToRoot(resolved + resolvedURL.search);
|
return relativeToRoot(resolved + resolvedURL.search);
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,9 @@ export default function astro({ config, logging }: AstroPluginOptions): vite.Plu
|
||||||
const src = hoistedScript.src!;
|
const src = hoistedScript.src!;
|
||||||
if (src.startsWith('/') && !isBrowserPath(src)) {
|
if (src.startsWith('/') && !isBrowserPath(src)) {
|
||||||
const publicDir = config.public.pathname.replace(/\/$/, '').split('/').pop() + '/';
|
const publicDir = config.public.pathname.replace(/\/$/, '').split('/').pop() + '/';
|
||||||
throw new Error(`\n\n<script src="${src}"> references an asset in the "${publicDir}" directory. Please add the "is:inline" directive to keep this asset from being bundled.\n\nFile: ${filename}`)
|
throw new Error(
|
||||||
|
`\n\n<script src="${src}"> references an asset in the "${publicDir}" directory. Please add the "is:inline" directive to keep this asset from being bundled.\n\nFile: ${filename}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue