refactor: move config files to @nuxt/config (#4212)

This commit is contained in:
Jonas Galvez 2018-10-27 17:27:16 -03:00 committed by Pooya Parsa
parent ec7794c5cd
commit 007ca05174
17 changed files with 39 additions and 14 deletions

View File

@ -4,7 +4,7 @@ import consola from 'consola'
import esm from 'esm'
import wrapAnsi from 'wrap-ansi'
import defaultsDeep from 'lodash/defaultsDeep'
import { nuxtServerConfig } from '@nuxt/common'
import { server as nuxtServerConfig } from '@nuxt/config'
const _require = esm(module, {
cache: false,

View File

@ -1,4 +1,4 @@
import { nuxtServerConfig } from '@nuxt/common'
import { server as nuxtServerConfig } from '@nuxt/config'
import { consola } from '../utils'
import * as utils from '../../src/utils'

View File

@ -9,8 +9,7 @@
"main": "dist/common.js",
"dependencies": {
"consola": "^1.4.4",
"lodash": "^4.17.11",
"std-env": "^2.0.2"
"lodash": "^4.17.11"
},
"publishConfig": {
"access": "public"

View File

@ -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 BuildContext } from './build/context'
export * from './utils'

View File

@ -1,3 +0,0 @@
import config from './config'
export default config

View File

@ -5,10 +5,9 @@ import defaults from 'lodash/defaults'
import pick from 'lodash/pick'
import isObject from 'lodash/isObject'
import consola from 'consola'
// eslint-disable-next-line
import { default as NuxtConfig, Modes } from '@nuxt/config'
import { isPureObject, isUrl, guardDir, isString } from './utils'
import Modes from './modes'
import NuxtConfig from './nuxt.config'
// hasValue utility
const hasValue = v => typeof v === 'string' && v

View File

@ -0,0 +1,3 @@
export default {
build: true
}

View 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"
}
}

View 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

View File

@ -9,7 +9,8 @@ import connect from 'connect'
import launchMiddleware from 'launch-editor-middleware'
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 errorMiddleware from './middleware/error'