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
5708e99e
Unverified
Commit
5708e99e
authored
Dec 11, 2018
by
Tim Neutkens
Committed by
GitHub
Dec 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run compilers sequentially when in lambdas mode (#5862)
parent
82c5cc38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
compiler.ts
packages/next/build/compiler.ts
+1
-1
index.ts
packages/next/build/index.ts
+11
-2
No files found.
packages/next/build/compiler.ts
View file @
5708e99e
import
webpack
from
'webpack'
import
webpack
from
'webpack'
type
CompilerResult
=
{
export
type
CompilerResult
=
{
errors
:
Error
[],
errors
:
Error
[],
warnings
:
Error
[]
warnings
:
Error
[]
}
}
...
...
packages/next/build/index.ts
View file @
5708e99e
...
@@ -6,7 +6,7 @@ import getBaseWebpackConfig from './webpack-config'
...
@@ -6,7 +6,7 @@ import getBaseWebpackConfig from './webpack-config'
import
{
generateBuildId
}
from
'./generate-build-id'
import
{
generateBuildId
}
from
'./generate-build-id'
import
{
writeBuildId
}
from
'./write-build-id'
import
{
writeBuildId
}
from
'./write-build-id'
import
{
isWriteable
}
from
'./is-writeable'
import
{
isWriteable
}
from
'./is-writeable'
import
{
runCompiler
}
from
'./compiler'
import
{
runCompiler
,
CompilerResult
}
from
'./compiler'
export
default
async
function
build
(
dir
:
string
,
conf
=
null
,
lambdas
:
boolean
=
false
):
Promise
<
void
>
{
export
default
async
function
build
(
dir
:
string
,
conf
=
null
,
lambdas
:
boolean
=
false
):
Promise
<
void
>
{
if
(
!
await
isWriteable
(
dir
))
{
if
(
!
await
isWriteable
(
dir
))
{
...
@@ -17,12 +17,21 @@ export default async function build (dir: string, conf = null, lambdas: boolean
...
@@ -17,12 +17,21 @@ export default async function build (dir: string, conf = null, lambdas: boolean
const
lambdasOption
=
config
.
lambdas
?
config
.
lambdas
:
lambdas
const
lambdasOption
=
config
.
lambdas
?
config
.
lambdas
:
lambdas
const
distDir
=
join
(
dir
,
config
.
distDir
)
const
distDir
=
join
(
dir
,
config
.
distDir
)
const
buildId
=
await
generateBuildId
(
config
.
generateBuildId
,
nanoid
)
const
buildId
=
await
generateBuildId
(
config
.
generateBuildId
,
nanoid
)
const
configs
:
any
=
await
Promise
.
all
([
const
configs
:
any
=
await
Promise
.
all
([
getBaseWebpackConfig
(
dir
,
{
buildId
,
isServer
:
false
,
config
,
lambdas
:
lambdasOption
}),
getBaseWebpackConfig
(
dir
,
{
buildId
,
isServer
:
false
,
config
,
lambdas
:
lambdasOption
}),
getBaseWebpackConfig
(
dir
,
{
buildId
,
isServer
:
true
,
config
,
lambdas
:
lambdasOption
})
getBaseWebpackConfig
(
dir
,
{
buildId
,
isServer
:
true
,
config
,
lambdas
:
lambdasOption
})
])
])
const
result
=
await
runCompiler
(
configs
)
let
result
:
CompilerResult
=
{
warnings
:
[],
errors
:
[]}
if
(
lambdasOption
)
{
const
clientResult
=
await
runCompiler
([
configs
[
0
]])
const
serverResult
=
await
runCompiler
([
configs
[
1
]])
result
=
{
warnings
:
[...
clientResult
.
warnings
,
...
serverResult
.
warnings
],
errors
:
[...
clientResult
.
errors
,
...
serverResult
.
errors
]}
}
else
{
result
=
await
runCompiler
(
configs
)
}
if
(
result
.
warnings
.
length
>
0
)
{
if
(
result
.
warnings
.
length
>
0
)
{
console
.
warn
(
'> Emitted warnings from webpack'
)
console
.
warn
(
'> Emitted warnings from webpack'
)
console
.
warn
(...
result
.
warnings
)
console
.
warn
(...
result
.
warnings
)
...
...
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