mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +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",
|
"repository": "nuxt/framework",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
"module": "./dist/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
"dist"
|
"dist",
|
||||||
|
"meta.js"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "jiti ../../scripts/build .",
|
"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 Hookable from 'hookable'
|
||||||
import { loadNuxtConfig, LoadNuxtConfigOptions, Nuxt, NuxtOptions, installModule } from '@nuxt/kit'
|
import { loadNuxtConfig, LoadNuxtConfigOptions, Nuxt, NuxtOptions, installModule } from '@nuxt/kit'
|
||||||
import { initNitro } from './nitro'
|
import { initNitro } from './nitro'
|
||||||
@ -52,8 +51,8 @@ export async function loadNuxt (loadOpts: LoadNuxtOptions = {}): Promise<Nuxt> {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Temp
|
// Temp
|
||||||
// @ts-ignore
|
const { appDir } = await import('@nuxt/app/meta')
|
||||||
options.appDir = dirname(require.resolve('@nuxt/app'))
|
options.appDir = appDir
|
||||||
options._majorVersion = 3
|
options._majorVersion = 3
|
||||||
|
|
||||||
const nuxt = createNuxt(options)
|
const nuxt = createNuxt(options)
|
||||||
|
Loading…
Reference in New Issue
Block a user