mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 10:54:49 +00:00
13 lines
461 B
TypeScript
13 lines
461 B
TypeScript
import { importModule } from './cjs'
|
|
|
|
export const loadKit = async (rootDir: string): Promise<typeof import('@nuxt/kit')> => {
|
|
try {
|
|
return await importModule('@nuxt/kit', rootDir) as typeof import('@nuxt/kit')
|
|
} catch (e: any) {
|
|
if (e.toString().includes("Cannot find module '@nuxt/kit'")) {
|
|
throw new Error('nuxi requires `@nuxt/kit` to be installed in your project. Try installing `nuxt3` or `@nuxt/bridge` first.')
|
|
}
|
|
throw e
|
|
}
|
|
}
|