mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
[ci] format
This commit is contained in:
parent
6a7cf0712d
commit
9676f94840
4 changed files with 10 additions and 15 deletions
|
@ -1,6 +1,4 @@
|
|||
import {
|
||||
createImage
|
||||
} from 'astro/content/runtime-assets';
|
||||
import { createImage } from 'astro/content/runtime-assets';
|
||||
|
||||
const assetsDir = '@@ASSETS_DIR@@';
|
||||
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -224,10 +224,8 @@ describe('Content Collections', () => {
|
|||
output: 'server',
|
||||
adapter: testAdapter(),
|
||||
vite: {
|
||||
plugins: [
|
||||
preventNodeBuiltinDependencyPlugin()
|
||||
]
|
||||
}
|
||||
plugins: [preventNodeBuiltinDependencyPlugin()],
|
||||
},
|
||||
});
|
||||
await fixture.build();
|
||||
app = await fixture.loadTestAdapterApp();
|
||||
|
|
|
@ -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}`)
|
||||
throw new Error(`Node builtins snuck in: ${name}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue