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
b1b0b889
Commit
b1b0b889
authored
Jul 16, 2017
by
Arunoda Susiripala
Committed by
GitHub
Jul 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move react-dom into commons.js always. (#2572)
parent
99dd045d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
webpack.js
server/build/webpack.js
+8
-1
No files found.
server/build/webpack.js
View file @
b1b0b889
import
{
resolve
,
join
}
from
'path'
import
{
resolve
,
join
,
sep
}
from
'path'
import
{
createHash
}
from
'crypto'
import
{
createHash
}
from
'crypto'
import
webpack
from
'webpack'
import
webpack
from
'webpack'
import
glob
from
'glob-promise'
import
glob
from
'glob-promise'
...
@@ -103,6 +103,13 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
...
@@ -103,6 +103,13 @@ export default async function createCompiler (dir, { dev = false, quiet = false,
return
module
.
context
&&
module
.
context
.
indexOf
(
'node_modules'
)
>=
0
return
module
.
context
&&
module
.
context
.
indexOf
(
'node_modules'
)
>=
0
}
}
// We need to move react-dom explicitly into common chunks.
// Otherwise, if some other page or module uses it, it might
// included in that bundle too.
if
(
module
.
context
.
indexOf
(
`
${
sep
}
react-dom
${
sep
}
`
)
>=
0
)
{
return
true
}
// If there are one or two pages, only move modules to common if they are
// If there are one or two pages, only move modules to common if they are
// used in all of the pages. Otherwise, move modules used in at-least
// used in all of the pages. Otherwise, move modules used in at-least
// 1/2 of the total pages into commons.
// 1/2 of the total pages into commons.
...
...
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