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
907dd27a
Unverified
Commit
907dd27a
authored
Mar 25, 2019
by
Tim Neutkens
Committed by
GitHub
Mar 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make main.js override work correctly (#6781)
parent
24d8ec56
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
webpack-config.ts
packages/next/build/webpack-config.ts
+9
-11
No files found.
packages/next/build/webpack-config.ts
View file @
907dd27a
...
@@ -327,18 +327,16 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, isServe
...
@@ -327,18 +327,16 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, isServe
const
originalEntry
:
any
=
webpackConfig
.
entry
const
originalEntry
:
any
=
webpackConfig
.
entry
if
(
typeof
originalEntry
!==
'undefined'
)
{
if
(
typeof
originalEntry
!==
'undefined'
)
{
webpackConfig
.
entry
=
async
()
=>
{
webpackConfig
.
entry
=
async
()
=>
{
const
entry
=
typeof
originalEntry
===
'function'
?
await
originalEntry
()
:
originalEntry
const
entry
:
WebpackEntrypoints
=
typeof
originalEntry
===
'function'
?
await
originalEntry
()
:
originalEntry
if
(
entry
&&
typeof
entry
!==
'string'
&&
!
Array
.
isArray
(
entry
))
{
// Server compilation doesn't have main.js
// Server compilation doesn't have main.js
if
(
entry
[
'main.js'
]
&&
entry
[
'main.js'
].
length
>
0
)
{
if
(
clientEntries
&&
entry
[
'main.js'
]
&&
entry
[
'main.js'
].
length
>
0
)
{
const
originalFile
=
clientEntries
[
CLIENT_STATIC_FILES_RUNTIME_MAIN
]
entry
[
CLIENT_STATIC_FILES_RUNTIME_MAIN
]
=
[
entry
[
CLIENT_STATIC_FILES_RUNTIME_MAIN
]
=
[
...
entry
[
'main.js'
],
...
entry
[
'main.js'
],
originalEntry
[
CLIENT_STATIC_FILES_RUNTIME_MAIN
]
originalFile
]
]
}
}
delete
entry
[
'main.js'
]
delete
entry
[
'main.js'
]
}
return
entry
return
entry
}
}
...
...
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