1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Move phases back to next/constants (#6104)

* Move phases back to next/constants

* Fix typescript error
This commit is contained in:
Tim Neutkens 2019-01-23 14:10:12 +01:00 committed by GitHub
parent d6ec10a4bf
commit 9112f63eba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 12 deletions

View file

@ -1,7 +1,3 @@
export const PHASE_EXPORT = 'phase-export'
export const PHASE_PRODUCTION_BUILD = 'phase-production-build'
export const PHASE_PRODUCTION_SERVER = 'phase-production-server'
export const PHASE_DEVELOPMENT_SERVER = 'phase-development-server'
export const PAGES_MANIFEST = 'pages-manifest.json'
export const BUILD_MANIFEST = 'build-manifest.json'
export const REACT_LOADABLE_MANIFEST = 'react-loadable-manifest.json'

View file

@ -10,7 +10,7 @@ import {serveStatic} from './serve-static'
import Router, {route, Route} from './router'
import { isInternalUrl, isBlockedPage } from './utils'
import loadConfig from 'next-server/next-config'
import {PHASE_PRODUCTION_SERVER, BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH, CLIENT_STATIC_FILES_RUNTIME} from 'next-server/constants'
import {BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH, CLIENT_STATIC_FILES_RUNTIME} from 'next-server/constants'
import * as envConfig from '../lib/runtime-config'
import {loadComponents} from './load-components'
@ -74,7 +74,7 @@ export default class Server {
}
private currentPhase(): string {
return PHASE_PRODUCTION_SERVER
return 'phase-production-server'
}
private logError(...args: any): void {

View file

@ -10,9 +10,6 @@ export default function NextToNextServer (): PluginObj {
if (source === 'next/dynamic') {
path.node.source.value = 'next-server/dynamic'
}
if (source === 'next/constants') {
path.node.source.value = 'next-server/constants'
}
if (source === 'next/config') {
path.node.source.value = 'next-server/config'
}

View file

@ -1,7 +1,7 @@
import { join } from 'path'
import nanoid from 'nanoid'
import loadConfig from 'next-server/next-config'
import { PHASE_PRODUCTION_BUILD } from 'next-server/constants'
import { PHASE_PRODUCTION_BUILD } from '../lib/constants'
import getBaseWebpackConfig from './webpack-config'
import {generateBuildId} from './generate-build-id'
import {writeBuildId} from './write-build-id'

View file

@ -6,7 +6,8 @@ import mkdirp from 'mkdirp-then'
import { resolve, join } from 'path'
import { existsSync, readFileSync } from 'fs'
import loadConfig from 'next-server/next-config'
import { PHASE_EXPORT, SERVER_DIRECTORY, PAGES_MANIFEST, CONFIG_FILE, BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH } from 'next-server/constants'
import { PHASE_EXPORT } from '../lib/constants'
import { SERVER_DIRECTORY, PAGES_MANIFEST, CONFIG_FILE, BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH } from 'next-server/constants'
import * as envConfig from 'next-server/config'
import createProgress from 'tty-aware-progress'

View file

@ -10,3 +10,8 @@ export const NEXT_PROJECT_ROOT_DIST_SERVER = join(NEXT_PROJECT_ROOT_DIST, 'serve
// we have to use a private alias
export const PAGES_DIR_ALIAS = 'private-next-pages'
export const DOT_NEXT_ALIAS = 'private-dot-next'
export const PHASE_EXPORT = 'phase-export'
export const PHASE_PRODUCTION_BUILD = 'phase-production-build'
export const PHASE_PRODUCTION_SERVER = 'phase-production-server'
export const PHASE_DEVELOPMENT_SERVER = 'phase-development-server'

View file

@ -2,7 +2,7 @@ import Server from 'next-server/dist/server/next-server'
import { join } from 'path'
import HotReloader from './hot-reloader'
import {route} from 'next-server/dist/server/router'
import {PHASE_DEVELOPMENT_SERVER} from 'next-server/constants'
import {PHASE_DEVELOPMENT_SERVER} from '../lib/constants'
import ErrorDebug from './error-debug'
export default class DevServer extends Server {