Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { dirname, join } from 'path' | ||
import { fileURLToPath } from 'url' | ||
import { promises as fs } from 'fs' | ||
import fg from 'fast-glob' | ||
|
||
const dir = dirname(fileURLToPath(import.meta.url)) | ||
|
||
const files = await fg('entry-*.mjs', { | ||
cwd: join(dir, '../dist/_nuxt'), | ||
absolute: true, | ||
onlyFiles: true, | ||
}) | ||
|
||
if (!files.length) | ||
throw new Error('No entry file found under dist/_nuxt/') | ||
|
||
if (files.length !== 1) | ||
throw new Error('Multiple entry files found under dist/_nuxt/') | ||
|
||
const file = files[0] | ||
const content = await fs.readFile(file, 'utf8') | ||
|
||
if (content.includes('NuxtPage')) | ||
throw new Error('<NuxtPage/> found in the entry file, the components are probably not registed correctly') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters