mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
fix(app): provide appDir via meta export
This commit is contained in:
parent
f47808f59a
commit
94d36976c7
5
packages/app/meta.js
Normal file
5
packages/app/meta.js
Normal file
@ -0,0 +1,5 @@
|
||||
const { resolve } = require('path')
|
||||
|
||||
module.exports = {
|
||||
appDir: resolve(__dirname, 'dist')
|
||||
}
|
@ -4,8 +4,10 @@
|
||||
"repository": "nuxt/framework",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
"files": [
|
||||
"dist"
|
||||
"dist",
|
||||
"meta.js"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "jiti ../../scripts/build .",
|
||||
|
1
packages/app/src/index.js
Normal file
1
packages/app/src/index.js
Normal file
@ -0,0 +1 @@
|
||||
export * from './index.ts'
|
@ -1,4 +1,3 @@
|
||||
import { dirname } from 'path'
|
||||
import Hookable from 'hookable'
|
||||
import { loadNuxtConfig, LoadNuxtConfigOptions, Nuxt, NuxtOptions, installModule } from '@nuxt/kit'
|
||||
import { initNitro } from './nitro'
|
||||
@ -52,8 +51,8 @@ export async function loadNuxt (loadOpts: LoadNuxtOptions = {}): Promise<Nuxt> {
|
||||
})
|
||||
|
||||
// Temp
|
||||
// @ts-ignore
|
||||
options.appDir = dirname(require.resolve('@nuxt/app'))
|
||||
const { appDir } = await import('@nuxt/app/meta')
|
||||
options.appDir = appDir
|
||||
options._majorVersion = 3
|
||||
|
||||
const nuxt = createNuxt(options)
|
||||
|
Loading…
Reference in New Issue
Block a user