diff options
4 files changed, 10 insertions, 15 deletions
diff --git a/packages/astro/src/content/template/virtual-mod-assets.mjs b/packages/astro/src/content/template/virtual-mod-assets.mjs index 32b41dd97..5f2a1d54c 100644 --- a/packages/astro/src/content/template/virtual-mod-assets.mjs +++ b/packages/astro/src/content/template/virtual-mod-assets.mjs @@ -1,6 +1,4 @@ -import { - createImage -} from 'astro/content/runtime-assets'; +import { createImage } from 'astro/content/runtime-assets'; const assetsDir = '@@ASSETS_DIR@@'; diff --git a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts index 6691326e9..faa6cb9be 100644 --- a/packages/astro/src/content/vite-plugin-content-virtual-mod.ts +++ b/packages/astro/src/content/vite-plugin-content-virtual-mod.ts @@ -43,9 +43,9 @@ export function astroContentVirtualModPlugin({ .replace('@@ASSETS_DIR@@', assetsDir); const astroContentVirtualModuleId = '\0' + VIRTUAL_MODULE_ID; - const allContents = settings.config.experimental.assets ? - (virtualModContents + virtualAssetsModContents) : - virtualModContents; + const allContents = settings.config.experimental.assets + ? virtualModContents + virtualAssetsModContents + : virtualModContents; return { name: 'astro-content-virtual-mod-plugin', diff --git a/packages/astro/test/content-collections.test.js b/packages/astro/test/content-collections.test.js index 6ede7cfc1..643f5858f 100644 --- a/packages/astro/test/content-collections.test.js +++ b/packages/astro/test/content-collections.test.js @@ -224,10 +224,8 @@ describe('Content Collections', () => { output: 'server', adapter: testAdapter(), vite: { - plugins: [ - preventNodeBuiltinDependencyPlugin() - ] - } + plugins: [preventNodeBuiltinDependencyPlugin()], + }, }); await fixture.build(); app = await fixture.loadTestAdapterApp(); diff --git a/packages/astro/test/test-plugins.js b/packages/astro/test/test-plugins.js index 75f944789..660933bfd 100644 --- a/packages/astro/test/test-plugins.js +++ b/packages/astro/test/test-plugins.js @@ -1,4 +1,3 @@ - export function preventNodeBuiltinDependencyPlugin() { // Verifies that `astro:content` does not have a hard dependency on Node builtins. // This is to verify it will run on Cloudflare and Deno @@ -6,12 +5,12 @@ export function preventNodeBuiltinDependencyPlugin() { name: 'verify-no-node-stuff', generateBundle() { const nodeModules = ['node:fs', 'node:url', 'node:worker_threads', 'node:path']; - nodeModules.forEach(name => { + nodeModules.forEach((name) => { const mod = this.getModuleInfo(name); - if(mod) { - throw new Error(`Node builtins snuck in: ${name}`) + if (mod) { + throw new Error(`Node builtins snuck in: ${name}`); } }); - } + }, }; } |