Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
a44788fb
Unverified
Commit
a44788fb
authored
Apr 10, 2019
by
Joe Haddad
Committed by
GitHub
Apr 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable flying shuttle when building for `now dev` (#6998)
parent
a1598b52
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
22 deletions
+30
-22
index.ts
packages/next/build/index.ts
+17
-13
chunk-graph-plugin.ts
packages/next/build/webpack/plugins/chunk-graph-plugin.ts
+5
-5
write-build-id.ts
packages/next/build/write-build-id.ts
+8
-4
No files found.
packages/next/build/index.ts
View file @
a44788fb
import
path
from
'path'
import
chalk
from
'chalk'
import
nanoid
from
'next/dist/compiled/nanoid/index.js'
import
loadConfig
from
'next-server/next-config'
import
{
PHASE_PRODUCTION_BUILD
}
from
'next-server/constants'
import
{
PHASE_PRODUCTION_BUILD
}
from
'next-server/constants'
import
getBaseWebpackConfig
from
'./webpack-config'
import
loadConfig
from
'next-server/next-config'
import
nanoid
from
'next/dist/compiled/nanoid/index.js'
import
path
from
'path'
import
formatWebpackMessages
from
'../client/dev-error-overlay/format-webpack-messages'
import
{
CompilerResult
,
runCompiler
}
from
'./compiler'
import
{
createEntrypoints
,
createPagesMapping
}
from
'./entries'
import
{
generateBuildId
}
from
'./generate-build-id'
import
{
generateBuildId
}
from
'./generate-build-id'
import
{
writeBuildId
}
from
'./write-build-id'
import
{
isWriteable
}
from
'./is-writeable'
import
{
isWriteable
}
from
'./is-writeable'
import
{
runCompiler
,
CompilerResult
}
from
'./compiler'
import
{
collectPages
,
getSpecifiedPages
,
printTreeView
}
from
'./utils'
import
{
createPagesMapping
,
createEntrypoints
}
from
'./entries'
import
getBaseWebpackConfig
from
'./webpack-config'
import
formatWebpackMessages
from
'../client/dev-error-overlay/format-webpack-messages'
import
{
writeBuildId
}
from
'./write-build-id'
import
chalk
from
'chalk'
import
{
collectPages
,
printTreeView
,
getSpecifiedPages
}
from
'./utils'
export
default
async
function
build
(
dir
:
string
,
conf
=
null
):
Promise
<
void
>
{
export
default
async
function
build
(
dir
:
string
,
conf
=
null
):
Promise
<
void
>
{
if
(
!
(
await
isWriteable
(
dir
)))
{
if
(
!
(
await
isWriteable
(
dir
)))
{
...
@@ -37,15 +38,18 @@ export default async function build(dir: string, conf = null): Promise<void> {
...
@@ -37,15 +38,18 @@ export default async function build(dir: string, conf = null): Promise<void> {
const
distDir
=
path
.
join
(
dir
,
config
.
distDir
)
const
distDir
=
path
.
join
(
dir
,
config
.
distDir
)
const
pagesDir
=
path
.
join
(
dir
,
'pages'
)
const
pagesDir
=
path
.
join
(
dir
,
'pages'
)
const
flyingShuttle
=
Boolean
(
config
.
experimental
.
flyingShuttle
)
const
isFlyingShuttle
=
Boolean
(
config
.
experimental
.
flyingShuttle
&&
!
process
.
env
.
__NEXT_BUILDER_EXPERIMENTAL_PAGE
)
const
selectivePageBuilding
=
Boolean
(
const
selectivePageBuilding
=
Boolean
(
f
lyingShuttle
||
process
.
env
.
__NEXT_BUILDER_EXPERIMENTAL_PAGE
isF
lyingShuttle
||
process
.
env
.
__NEXT_BUILDER_EXPERIMENTAL_PAGE
)
)
if
(
selectivePageBuilding
&&
config
.
target
!==
'serverless'
)
{
if
(
selectivePageBuilding
&&
config
.
target
!==
'serverless'
)
{
throw
new
Error
(
throw
new
Error
(
`Cannot use
${
`Cannot use
${
f
lyingShuttle
?
'flying shuttle'
:
'`now dev`'
isF
lyingShuttle
?
'flying shuttle'
:
'`now dev`'
}
without the serverless target.`
}
without the serverless target.`
)
)
}
}
...
...
packages/next/build/webpack/plugins/chunk-graph-plugin.ts
View file @
a44788fb
import
{
Compiler
,
Plugin
}
from
'webpack'
import
{
createHash
}
from
'crypto'
import
path
from
'path'
import
fs
from
'fs'
import
{
CLIENT_STATIC_FILES_RUNTIME_MAIN
}
from
'next-server/constants'
import
{
EOL
}
from
'os'
import
{
EOL
}
from
'os'
import
path
from
'path'
import
{
parse
}
from
'querystring'
import
{
parse
}
from
'querystring'
import
{
CLIENT_STATIC_FILES_RUNTIME_MAIN
}
from
'next-server/constants'
import
{
Compiler
,
Plugin
}
from
'webpack'
import
fs
from
'fs'
import
{
createHash
}
from
'crypto'
function
getFiles
(
dir
:
string
,
modules
:
any
[]):
string
[]
{
function
getFiles
(
dir
:
string
,
modules
:
any
[]):
string
[]
{
if
(
!
(
modules
&&
modules
.
length
))
{
if
(
!
(
modules
&&
modules
.
length
))
{
...
...
packages/next/build/write-build-id.ts
View file @
a44788fb
import
fs
from
'fs'
import
fs
from
'fs'
import
{
promisify
}
from
'util'
import
{
promisify
}
from
'util'
import
{
join
}
from
'path'
import
{
join
}
from
'path'
import
{
BUILD_ID_FILE
,
HEAD_BUILD_ID_FILE
}
from
'next-server/constants'
import
{
BUILD_ID_FILE
,
HEAD_BUILD_ID_FILE
}
from
'next-server/constants'
const
writeFile
=
promisify
(
fs
.
writeFile
)
const
writeFile
=
promisify
(
fs
.
writeFile
)
export
async
function
writeBuildId
(
distDir
:
string
,
buildId
:
string
,
headBuildId
:
boolean
):
Promise
<
void
>
{
export
async
function
writeBuildId
(
distDir
:
string
,
buildId
:
string
,
headBuildId
:
boolean
):
Promise
<
void
>
{
const
buildIdPath
=
join
(
distDir
,
BUILD_ID_FILE
)
const
buildIdPath
=
join
(
distDir
,
BUILD_ID_FILE
)
await
writeFile
(
buildIdPath
,
buildId
,
'utf8'
)
await
writeFile
(
buildIdPath
,
buildId
,
'utf8'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment