0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

[ci] format

This commit is contained in:
matthewp 2023-03-13 19:38:46 +00:00 committed by fredkbot
parent 6a7cf0712d
commit 9676f94840
4 changed files with 10 additions and 15 deletions

View file

@ -1,6 +1,4 @@
import {
createImage
} from 'astro/content/runtime-assets';
import { createImage } from 'astro/content/runtime-assets';
const assetsDir = '@@ASSETS_DIR@@';

View file

@ -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',

View file

@ -224,10 +224,8 @@ describe('Content Collections', () => {
output: 'server',
adapter: testAdapter(),
vite: {
plugins: [
preventNodeBuiltinDependencyPlugin()
]
}
plugins: [preventNodeBuiltinDependencyPlugin()],
},
});
await fixture.build();
app = await fixture.loadTestAdapterApp();

View file

@ -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}`);
}
});
}
},
};
}