mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 23:32:38 +00:00
refactor: move config files to @nuxt/config (#4212)
This commit is contained in:
parent
ec7794c5cd
commit
007ca05174
@ -4,7 +4,7 @@ import consola from 'consola'
|
|||||||
import esm from 'esm'
|
import esm from 'esm'
|
||||||
import wrapAnsi from 'wrap-ansi'
|
import wrapAnsi from 'wrap-ansi'
|
||||||
import defaultsDeep from 'lodash/defaultsDeep'
|
import defaultsDeep from 'lodash/defaultsDeep'
|
||||||
import { nuxtServerConfig } from '@nuxt/common'
|
import { server as nuxtServerConfig } from '@nuxt/config'
|
||||||
|
|
||||||
const _require = esm(module, {
|
const _require = esm(module, {
|
||||||
cache: false,
|
cache: false,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { nuxtServerConfig } from '@nuxt/common'
|
import { server as nuxtServerConfig } from '@nuxt/config'
|
||||||
import { consola } from '../utils'
|
import { consola } from '../utils'
|
||||||
import * as utils from '../../src/utils'
|
import * as utils from '../../src/utils'
|
||||||
|
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
"main": "dist/common.js",
|
"main": "dist/common.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"consola": "^1.4.4",
|
"consola": "^1.4.4",
|
||||||
"lodash": "^4.17.11",
|
"lodash": "^4.17.11"
|
||||||
"std-env": "^2.0.2"
|
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
export { default as Modes } from './modes'
|
|
||||||
export { default as NuxtConfig } from './nuxt.config'
|
|
||||||
export { default as nuxtServerConfig } from './config/server'
|
|
||||||
export { default as Options } from './options'
|
export { default as Options } from './options'
|
||||||
export { default as BuildContext } from './build/context'
|
export { default as BuildContext } from './build/context'
|
||||||
export * from './utils'
|
export * from './utils'
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
import config from './config'
|
|
||||||
|
|
||||||
export default config
|
|
@ -5,10 +5,9 @@ import defaults from 'lodash/defaults'
|
|||||||
import pick from 'lodash/pick'
|
import pick from 'lodash/pick'
|
||||||
import isObject from 'lodash/isObject'
|
import isObject from 'lodash/isObject'
|
||||||
import consola from 'consola'
|
import consola from 'consola'
|
||||||
|
// eslint-disable-next-line
|
||||||
|
import { default as NuxtConfig, Modes } from '@nuxt/config'
|
||||||
import { isPureObject, isUrl, guardDir, isString } from './utils'
|
import { isPureObject, isUrl, guardDir, isString } from './utils'
|
||||||
import Modes from './modes'
|
|
||||||
import NuxtConfig from './nuxt.config'
|
|
||||||
|
|
||||||
// hasValue utility
|
// hasValue utility
|
||||||
const hasValue = v => typeof v === 'string' && v
|
const hasValue = v => typeof v === 'string' && v
|
||||||
|
3
packages/config/package.js
Normal file
3
packages/config/package.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export default {
|
||||||
|
build: true
|
||||||
|
}
|
18
packages/config/package.json
Normal file
18
packages/config/package.json
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "@nuxt/config",
|
||||||
|
"version": "2.2.0",
|
||||||
|
"repository": "nuxt/nuxt.js",
|
||||||
|
"license": "MIT",
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"main": "dist/config.js",
|
||||||
|
"dependencies": {
|
||||||
|
"consola": "^1.4.4",
|
||||||
|
"lodash": "^4.17.11",
|
||||||
|
"std-env": "^2.0.2"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
}
|
||||||
|
}
|
11
packages/config/src/index.js
Normal file
11
packages/config/src/index.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import NuxtConfig from './config'
|
||||||
|
|
||||||
|
// Export individual bundles for easier access
|
||||||
|
export { default as Modes } from './modes'
|
||||||
|
export { default as build } from './config/build'
|
||||||
|
export { default as messages } from './config/messages'
|
||||||
|
export { default as render } from './config/render'
|
||||||
|
export { default as router } from './config/router'
|
||||||
|
export { default as server } from './config/server'
|
||||||
|
|
||||||
|
export default NuxtConfig
|
@ -9,7 +9,8 @@ import connect from 'connect'
|
|||||||
import launchMiddleware from 'launch-editor-middleware'
|
import launchMiddleware from 'launch-editor-middleware'
|
||||||
import consola from 'consola'
|
import consola from 'consola'
|
||||||
|
|
||||||
import { NuxtConfig, isUrl, timeout, waitFor, determineGlobals } from '@nuxt/common'
|
import { isUrl, timeout, waitFor, determineGlobals } from '@nuxt/common'
|
||||||
|
import NuxtConfig from '@nuxt/config'
|
||||||
|
|
||||||
import MetaRenderer from './meta'
|
import MetaRenderer from './meta'
|
||||||
import errorMiddleware from './middleware/error'
|
import errorMiddleware from './middleware/error'
|
||||||
|
Loading…
Reference in New Issue
Block a user