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
ccf821ae
Commit
ccf821ae
authored
Nov 01, 2018
by
Tim Neutkens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to pass buildId
parent
c6c64b4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
index.js
packages/next-build/index.js
+2
-2
next-build
packages/next/bin/next-build
+3
-2
No files found.
packages/next-build/index.js
View file @
ccf821ae
...
...
@@ -318,9 +318,9 @@ function rewriteFileName(Bundle, buildId) {
}
}
module
.
exports
=
async
function
build
({
dir
,
conf
,
entrypoint
})
{
module
.
exports
=
async
function
build
({
dir
,
conf
,
entrypoint
,
buildid
:
passedBuildId
})
{
const
config
=
loadConfig
(
PHASE_PRODUCTION_BUILD
,
dir
,
conf
)
const
buildId
=
await
config
.
generateBuildId
().
trim
()
// defaults to a uuid
const
buildId
=
passedBuildId
||
await
config
.
generateBuildId
().
trim
()
// defaults to a uuid
const
distDir
=
path
.
join
(
dir
,
config
.
distDir
)
try
{
...
...
packages/next/bin/next-build
View file @
ccf821ae
...
...
@@ -11,7 +11,7 @@ const argv = parseArgs(process.argv.slice(2), {
h
:
'help'
},
boolean
:
[
'h'
],
string
:
[
'entrypoint'
]
string
:
[
'entrypoint'
,
'buildid'
]
})
if
(
argv
.
help
)
{
...
...
@@ -31,6 +31,7 @@ if (argv.help) {
const
dir
=
resolve
(
argv
.
_
[
0
]
||
'.'
)
const
entrypoint
=
argv
.
entrypoint
const
buildid
=
argv
.
buildid
// Check if pages dir exists and warn if not
if
(
!
existsSync
(
dir
))
{
...
...
@@ -45,7 +46,7 @@ if (!existsSync(join(dir, 'pages'))) {
printAndExit
(
'> Couldn
\'
t find a `pages` directory. Please create one under the project root'
)
}
build
({
dir
,
entrypoint
})
build
({
dir
,
entrypoint
,
entrypoint
})
.
catch
((
err
)
=>
{
printAndExit
(
err
)
})
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