mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
perf(nuxt): import defineNuxtConfig
from nuxt/config
(#7485)
This commit is contained in:
parent
5d79ed5f9e
commit
3a60bf69ce
7
packages/nuxt/config.cjs
Normal file
7
packages/nuxt/config.cjs
Normal file
@ -0,0 +1,7 @@
|
||||
function defineNuxtConfig (config) {
|
||||
return config
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
defineNuxtConfig
|
||||
}
|
4
packages/nuxt/config.d.ts
vendored
Normal file
4
packages/nuxt/config.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import { NuxtConfig } from '@nuxt/schema'
|
||||
export { NuxtConfig } from '@nuxt/schema'
|
||||
|
||||
export declare function defineNuxtConfig(config: NuxtConfig): NuxtConfig
|
5
packages/nuxt/config.mjs
Normal file
5
packages/nuxt/config.mjs
Normal file
@ -0,0 +1,5 @@
|
||||
function defineNuxtConfig (config) {
|
||||
return config
|
||||
}
|
||||
|
||||
export { defineNuxtConfig }
|
@ -12,6 +12,11 @@
|
||||
},
|
||||
"exports": {
|
||||
".": "./dist/index.mjs",
|
||||
"./config": {
|
||||
"import": "./config.mjs",
|
||||
"require": "./config.cjs",
|
||||
"types": "./config.d.ts"
|
||||
},
|
||||
"./app": "./dist/app/index.mjs",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
@ -24,7 +29,8 @@
|
||||
"app.d.ts",
|
||||
"bin",
|
||||
"types.d.ts",
|
||||
"dist"
|
||||
"dist",
|
||||
"config.*"
|
||||
],
|
||||
"scripts": {
|
||||
"prepack": "unbuild"
|
||||
|
@ -234,9 +234,10 @@ export async function loadNuxt (opts: LoadNuxtOptions): Promise<Nuxt> {
|
||||
return nuxt
|
||||
}
|
||||
|
||||
/** @deprecated Use import { defineNuxtConfig } from 'nuxt/config' */
|
||||
export function defineNuxtConfig (config: NuxtConfig): NuxtConfig {
|
||||
return config
|
||||
}
|
||||
|
||||
// For a convenience import together with `defineNuxtConfig`
|
||||
/** @deprecated Use import type { NuxtConfig } from 'nuxt/config' */
|
||||
export type { NuxtConfig }
|
||||
|
@ -1,3 +1,3 @@
|
||||
import { defineNuxtConfig } from 'nuxt'
|
||||
import { defineNuxtConfig } from 'nuxt/config'
|
||||
|
||||
export default defineNuxtConfig({})
|
||||
|
Loading…
Reference in New Issue
Block a user