mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 02:44:51 +00:00
13 lines
456 B
TypeScript
13 lines
456 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) {
|
|
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
|
|
}
|
|
}
|