2019-02-19 22:45:07 +01:00
import { join } from 'path'
2018-06-14 19:30:14 +02:00
export const NEXT_PROJECT_ROOT = join ( __dirname , '..' , '..' )
export const NEXT_PROJECT_ROOT_DIST = join ( NEXT_PROJECT_ROOT , 'dist' )
2019-05-29 13:57:26 +02:00
export const NEXT_PROJECT_ROOT_NODE_MODULES = join (
NEXT_PROJECT_ROOT ,
'node_modules'
)
export const NEXT_PROJECT_ROOT_DIST_CLIENT = join (
NEXT_PROJECT_ROOT_DIST ,
'client'
)
export const NEXT_PROJECT_ROOT_DIST_SERVER = join (
NEXT_PROJECT_ROOT_DIST ,
'server'
)
2019-01-08 23:10:32 +01:00
2019-07-25 19:39:29 +02:00
// Regex for API routes
export const API_ROUTE = /^\/api(?:\/|$)/
2019-01-08 23:10:32 +01:00
// Because on Windows absolute paths in the generated code can break because of numbers, eg 1 in the path,
// we have to use a private alias
export const PAGES_DIR_ALIAS = 'private-next-pages'
export const DOT_NEXT_ALIAS = 'private-dot-next'
2019-09-16 23:06:30 +02:00
export const PUBLIC_DIR_MIDDLEWARE_CONFLICT = ` You can not have a '_next' folder inside of your public folder. This conflicts with the internal '/_next' route. https://err.sh/zeit/next.js/public-next-folder-conflict `
2019-09-24 10:50:04 +02:00
2020-02-27 18:57:39 +01:00
export const SSG_GET_INITIAL_PROPS_CONFLICT = ` You can not use getInitialProps with getStaticProps. To use SSG, please remove your getInitialProps `
2020-01-27 23:50:59 +01:00
2020-02-27 18:57:39 +01:00
export const SERVER_PROPS_GET_INIT_PROPS_CONFLICT = ` You can not use getInitialProps with getServerSideProps. Please remove getInitialProps. `
2020-01-27 23:50:59 +01:00
2020-02-27 18:57:39 +01:00
export const SERVER_PROPS_SSG_CONFLICT = ` You can not use getStaticProps with getServerSideProps. To use SSG, please remove getServerSideProps `
2020-02-01 15:47:42 +01:00
2020-02-27 18:04:30 +01:00
export const PAGES_404_GET_INITIAL_PROPS_ERROR = ` \` pages/404 \` can not have getInitialProps/getServerSideProps, https://err.sh/zeit/next.js/404-get-initial-props `