[ci] format
This commit is contained in:
parent
2a7dd040e8
commit
f6d61e6e72
2 changed files with 7 additions and 10 deletions
|
@ -54,13 +54,10 @@ const createIntegration = (options: IntegrationOptions = {}): AstroIntegration =
|
||||||
// Added to globalThis to share the same map in Node and Vite
|
// Added to globalThis to share the same map in Node and Vite
|
||||||
function addStaticImage(transform: TransformOptions) {
|
function addStaticImage(transform: TransformOptions) {
|
||||||
staticImages.set(propsToFilename(transform), transform);
|
staticImages.set(propsToFilename(transform), transform);
|
||||||
};
|
}
|
||||||
|
|
||||||
// TODO: Add support for custom, user-provided filename format functions
|
// TODO: Add support for custom, user-provided filename format functions
|
||||||
function filenameFormat(
|
function filenameFormat(transform: TransformOptions, searchParams: URLSearchParams) {
|
||||||
transform: TransformOptions,
|
|
||||||
searchParams: URLSearchParams
|
|
||||||
) {
|
|
||||||
if (mode === 'ssg') {
|
if (mode === 'ssg') {
|
||||||
return isRemoteImage(transform.src)
|
return isRemoteImage(transform.src)
|
||||||
? path.join(OUTPUT_DIR, path.basename(propsToFilename(transform)))
|
? path.join(OUTPUT_DIR, path.basename(propsToFilename(transform)))
|
||||||
|
@ -72,7 +69,7 @@ const createIntegration = (options: IntegrationOptions = {}): AstroIntegration =
|
||||||
} else {
|
} else {
|
||||||
return `${ROUTE_PATTERN}?${searchParams.toString()}`;
|
return `${ROUTE_PATTERN}?${searchParams.toString()}`;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// Initialize the integration's globalThis namespace
|
// Initialize the integration's globalThis namespace
|
||||||
// This is needed to share scope between Node and Vite
|
// This is needed to share scope between Node and Vite
|
||||||
|
@ -82,7 +79,7 @@ const createIntegration = (options: IntegrationOptions = {}): AstroIntegration =
|
||||||
command,
|
command,
|
||||||
addStaticImage,
|
addStaticImage,
|
||||||
filenameFormat,
|
filenameFormat,
|
||||||
}
|
};
|
||||||
|
|
||||||
if (mode === 'ssr') {
|
if (mode === 'ssr') {
|
||||||
injectRoute({
|
injectRoute({
|
||||||
|
|
Loading…
Reference in a new issue