diff --git a/packages/integrations/image/src/vite-plugin-astro-image.ts b/packages/integrations/image/src/vite-plugin-astro-image.ts index 410d9bbd7..3eee310e8 100644 --- a/packages/integrations/image/src/vite-plugin-astro-image.ts +++ b/packages/integrations/image/src/vite-plugin-astro-image.ts @@ -1,9 +1,9 @@ import type { AstroConfig } from 'astro'; import MagicString from 'magic-string'; import fs from 'node:fs/promises'; -import { basename, extname, join } from 'node:path'; +import { basename, extname } from 'node:path'; import { Readable } from 'node:stream'; -import { fileURLToPath, pathToFileURL } from 'node:url'; +import { pathToFileURL } from 'node:url'; import type { Plugin, ResolvedConfig } from 'vite'; import type { IntegrationOptions } from './index.js'; import type { InputFormat } from './loaders/index.js'; diff --git a/packages/integrations/image/test/image-ssg.test.js b/packages/integrations/image/test/image-ssg.test.js index d342db05d..5bc1c1e0d 100644 --- a/packages/integrations/image/test/image-ssg.test.js +++ b/packages/integrations/image/test/image-ssg.test.js @@ -7,7 +7,8 @@ import { join } from 'node:path'; import { loadFixture } from './test-utils.js'; const __dirname = fileURLToPath(new URL('.', import.meta.url)); -const toAstroImage = (relpath) => '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-image', relpath)).pathname; +const toAstroImage = (relpath) => + '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-image', relpath)).pathname; describe('SSG images - dev', function () { let fixture; @@ -234,7 +235,11 @@ describe('SSG images - build', function () { }); function verifyImage(pathname, expected) { - const dist = join(fileURLToPath(new URL('.', import.meta.url)), 'fixtures/basic-image/dist', pathname); + const dist = join( + fileURLToPath(new URL('.', import.meta.url)), + 'fixtures/basic-image/dist', + pathname + ); const result = sizeOf(dist); expect(result).to.deep.equal(expected); } diff --git a/packages/integrations/image/test/image-ssr-dev.test.js b/packages/integrations/image/test/image-ssr-dev.test.js index 7f0e0229e..fbaa6f965 100644 --- a/packages/integrations/image/test/image-ssr-dev.test.js +++ b/packages/integrations/image/test/image-ssr-dev.test.js @@ -6,7 +6,8 @@ import { loadFixture } from './test-utils.js'; import testAdapter from '../../../astro/test/test-adapter.js'; const __dirname = fileURLToPath(new URL('.', import.meta.url)); -const toAstroImage = (relpath) => '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-image', relpath)).pathname; +const toAstroImage = (relpath) => + '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-image', relpath)).pathname; describe('SSR images - dev', function () { let fixture; diff --git a/packages/integrations/image/test/picture-ssg.test.js b/packages/integrations/image/test/picture-ssg.test.js index be6d05506..985058192 100644 --- a/packages/integrations/image/test/picture-ssg.test.js +++ b/packages/integrations/image/test/picture-ssg.test.js @@ -8,7 +8,8 @@ import { join } from 'node:path'; import { loadFixture } from './test-utils.js'; const __dirname = fileURLToPath(new URL('.', import.meta.url)); -const toAstroImage = (relpath) => '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-picture', relpath)).pathname; +const toAstroImage = (relpath) => + '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-picture', relpath)).pathname; describe('SSG pictures - dev', function () { let fixture; diff --git a/packages/integrations/image/test/picture-ssr-dev.test.js b/packages/integrations/image/test/picture-ssr-dev.test.js index e3e1d60b0..325e0d08b 100644 --- a/packages/integrations/image/test/picture-ssr-dev.test.js +++ b/packages/integrations/image/test/picture-ssr-dev.test.js @@ -6,7 +6,8 @@ import { loadFixture } from './test-utils.js'; import testAdapter from '../../../astro/test/test-adapter.js'; const __dirname = fileURLToPath(new URL('.', import.meta.url)); -const toAstroImage = (relpath) => '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-picture', relpath)).pathname; +const toAstroImage = (relpath) => + '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/basic-picture', relpath)).pathname; describe('SSR pictures - dev', function () { let fixture; diff --git a/packages/integrations/image/test/squoosh-service.test.js b/packages/integrations/image/test/squoosh-service.test.js index 2e7c6d109..9a3eabd8e 100644 --- a/packages/integrations/image/test/squoosh-service.test.js +++ b/packages/integrations/image/test/squoosh-service.test.js @@ -5,7 +5,8 @@ import { join } from 'node:path'; import { loadFixture } from './test-utils.js'; const __dirname = fileURLToPath(new URL('.', import.meta.url)); -const toAstroImage = (relpath) => '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/squoosh-service', relpath)).pathname; +const toAstroImage = (relpath) => + '/@astroimage' + pathToFileURL(join(__dirname, 'fixtures/squoosh-service', relpath)).pathname; describe('Squoosh service', function () { let fixture;