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
c0a10b99
Unverified
Commit
c0a10b99
authored
Apr 22, 2019
by
Tim Neutkens
Committed by
GitHub
Apr 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for entry to resolve in production build (#7104)
* Wait for entry to resolve in production build * Return promise
parent
d2b0db81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
webpack-config.ts
packages/next/build/webpack-config.ts
+6
-1
hot-reloader.js
packages/next/server/hot-reloader.js
+2
-2
No files found.
packages/next/build/webpack-config.ts
View file @
c0a10b99
...
@@ -20,7 +20,7 @@ import { importAutoDllPlugin } from './webpack/plugins/dll-import'
...
@@ -20,7 +20,7 @@ import { importAutoDllPlugin } from './webpack/plugins/dll-import'
import
{
WebpackEntrypoints
}
from
'./entries'
import
{
WebpackEntrypoints
}
from
'./entries'
type
ExcludesFalse
=
<
T
>
(
x
:
T
|
false
)
=>
x
is
T
type
ExcludesFalse
=
<
T
>
(
x
:
T
|
false
)
=>
x
is
T
export
default
function
getBaseWebpackConfig
(
dir
:
string
,
{
dev
=
false
,
debug
=
false
,
isServer
=
false
,
buildId
,
config
,
target
=
'server'
,
entrypoints
,
selectivePageBuilding
=
false
,
selectivePageBuildingCacheIdentifier
=
''
}:
{
dev
?:
boolean
,
debug
?:
boolean
,
isServer
?:
boolean
,
buildId
:
string
,
config
:
any
,
target
?:
string
,
entrypoints
:
WebpackEntrypoints
,
selectivePageBuilding
?:
boolean
,
selectivePageBuildingCacheIdentifier
?:
string
}):
webpack
.
Configuration
{
export
default
async
function
getBaseWebpackConfig
(
dir
:
string
,
{
dev
=
false
,
debug
=
false
,
isServer
=
false
,
buildId
,
config
,
target
=
'server'
,
entrypoints
,
selectivePageBuilding
=
false
,
selectivePageBuildingCacheIdentifier
=
''
}:
{
dev
?:
boolean
,
debug
?:
boolean
,
isServer
?:
boolean
,
buildId
:
string
,
config
:
any
,
target
?:
string
,
entrypoints
:
WebpackEntrypoints
,
selectivePageBuilding
?:
boolean
,
selectivePageBuildingCacheIdentifier
?:
string
}):
Promise
<
webpack
.
Configuration
>
{
const
distDir
=
path
.
join
(
dir
,
config
.
distDir
)
const
distDir
=
path
.
join
(
dir
,
config
.
distDir
)
const
defaultLoaders
=
{
const
defaultLoaders
=
{
babel
:
{
babel
:
{
...
@@ -375,5 +375,10 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, debug =
...
@@ -375,5 +375,10 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, debug =
}
}
}
}
if
(
!
dev
)
{
// @ts-ignore entry is always a function
webpackConfig
.
entry
=
await
webpackConfig
.
entry
()
}
return
webpackConfig
return
webpackConfig
}
}
packages/next/server/hot-reloader.js
View file @
c0a10b99
...
@@ -175,10 +175,10 @@ export default class HotReloader {
...
@@ -175,10 +175,10 @@ export default class HotReloader {
let
additionalClientEntrypoints
=
{}
let
additionalClientEntrypoints
=
{}
additionalClientEntrypoints
[
CLIENT_STATIC_FILES_RUNTIME_AMP
]
=
`.
${
sep
}
`
+
relativePath
(
this
.
dir
,
join
(
NEXT_PROJECT_ROOT_DIST_CLIENT
,
'amp-dev'
))
additionalClientEntrypoints
[
CLIENT_STATIC_FILES_RUNTIME_AMP
]
=
`.
${
sep
}
`
+
relativePath
(
this
.
dir
,
join
(
NEXT_PROJECT_ROOT_DIST_CLIENT
,
'amp-dev'
))
return
[
return
Promise
.
all
(
[
getBaseWebpackConfig
(
this
.
dir
,
{
dev
:
true
,
isServer
:
false
,
config
:
this
.
config
,
buildId
:
this
.
buildId
,
entrypoints
:
{
...
entrypoints
.
client
,
...
additionalClientEntrypoints
}
}),
getBaseWebpackConfig
(
this
.
dir
,
{
dev
:
true
,
isServer
:
false
,
config
:
this
.
config
,
buildId
:
this
.
buildId
,
entrypoints
:
{
...
entrypoints
.
client
,
...
additionalClientEntrypoints
}
}),
getBaseWebpackConfig
(
this
.
dir
,
{
dev
:
true
,
isServer
:
true
,
config
:
this
.
config
,
buildId
:
this
.
buildId
,
entrypoints
:
entrypoints
.
server
})
getBaseWebpackConfig
(
this
.
dir
,
{
dev
:
true
,
isServer
:
true
,
config
:
this
.
config
,
buildId
:
this
.
buildId
,
entrypoints
:
entrypoints
.
server
})
]
]
)
}
}
async
start
()
{
async
start
()
{
...
...
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