mirror of
https://github.com/withastro/astro.git
synced 2025-02-24 22:46:02 -05:00
refactor: early return
This commit is contained in:
parent
de79f2bba0
commit
e10167f359
1 changed files with 9 additions and 10 deletions
|
@ -40,7 +40,7 @@ export function vitePluginDb(params: VitePluginDBParams): VitePlugin {
|
||||||
name: 'astro:db',
|
name: 'astro:db',
|
||||||
enforce: 'pre',
|
enforce: 'pre',
|
||||||
async resolveId(id, rawImporter) {
|
async resolveId(id, rawImporter) {
|
||||||
if (id === VIRTUAL_MODULE_ID) {
|
if (id !== VIRTUAL_MODULE_ID) return;
|
||||||
if (params.connectToStudio || !params.shouldSeed) return resolvedVirtualModuleId;
|
if (params.connectToStudio || !params.shouldSeed) return resolvedVirtualModuleId;
|
||||||
|
|
||||||
const importer = rawImporter ? await this.resolve(rawImporter) : null;
|
const importer = rawImporter ? await this.resolve(rawImporter) : null;
|
||||||
|
@ -52,7 +52,6 @@ export function vitePluginDb(params: VitePluginDBParams): VitePlugin {
|
||||||
return resolvedSeedVirtualModuleId;
|
return resolvedSeedVirtualModuleId;
|
||||||
}
|
}
|
||||||
return resolvedVirtualModuleId;
|
return resolvedVirtualModuleId;
|
||||||
}
|
|
||||||
},
|
},
|
||||||
load(id) {
|
load(id) {
|
||||||
if (id !== resolvedVirtualModuleId && id !== resolvedSeedVirtualModuleId) return;
|
if (id !== resolvedVirtualModuleId && id !== resolvedSeedVirtualModuleId) return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue