2018-06-14 17:30:14 +00:00
|
|
|
import {join} from 'path'
|
2018-02-23 13:42:06 +00:00
|
|
|
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'
|
2018-03-30 13:08:09 +00:00
|
|
|
export const PAGES_MANIFEST = 'pages-manifest.json'
|
2018-04-12 07:47:42 +00:00
|
|
|
export const BUILD_MANIFEST = 'build-manifest.json'
|
2018-07-24 09:24:40 +00:00
|
|
|
export const REACT_LOADABLE_MANIFEST = 'react-loadable-manifest.json'
|
2018-05-31 18:56:04 +00:00
|
|
|
export const SERVER_DIRECTORY = 'server'
|
2018-06-04 09:38:46 +00:00
|
|
|
export const CONFIG_FILE = 'next.config.js'
|
2018-06-04 13:45:39 +00:00
|
|
|
export const BUILD_ID_FILE = 'BUILD_ID'
|
|
|
|
export const BLOCKED_PAGES = [
|
|
|
|
'/_document',
|
|
|
|
'/_app',
|
|
|
|
'/_error'
|
|
|
|
]
|
2018-07-25 11:45:42 +00:00
|
|
|
// matches static/<buildid>/pages/<page>.js
|
|
|
|
export const IS_BUNDLED_PAGE_REGEX = /^static[/\\][^/\\]+[/\\]pages.*\.js$/
|
|
|
|
// matches static/<buildid>/pages/:page*.js
|
|
|
|
export const ROUTE_NAME_REGEX = /^static[/\\][^/\\]+[/\\]pages[/\\](.*)\.js$/
|
2018-06-14 17:30:14 +00:00
|
|
|
export const NEXT_PROJECT_ROOT = join(__dirname, '..', '..')
|
|
|
|
export const NEXT_PROJECT_ROOT_DIST = join(NEXT_PROJECT_ROOT, 'dist')
|
|
|
|
export const NEXT_PROJECT_ROOT_NODE_MODULES = join(NEXT_PROJECT_ROOT, 'node_modules')
|
|
|
|
export const DEFAULT_PAGES_DIR = join(NEXT_PROJECT_ROOT_DIST, 'pages')
|
2018-07-25 11:45:42 +00:00
|
|
|
export const CLIENT_STATIC_FILES_PATH = 'static'
|
2018-07-27 17:29:25 +00:00
|
|
|
export const CLIENT_STATIC_FILES_RUNTIME = 'runtime'
|
|
|
|
export const CLIENT_STATIC_FILES_RUNTIME_PATH = `${CLIENT_STATIC_FILES_PATH}/${CLIENT_STATIC_FILES_RUNTIME}`
|
|
|
|
// static/runtime/main.js
|
|
|
|
export const CLIENT_STATIC_FILES_RUNTIME_MAIN = `${CLIENT_STATIC_FILES_RUNTIME_PATH}/main.js`
|
|
|
|
// static/runtime/webpack.js
|
|
|
|
export const CLIENT_STATIC_FILES_RUNTIME_WEBPACK = `${CLIENT_STATIC_FILES_RUNTIME_PATH}/webpack.js`
|