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
c56e9629
Unverified
Commit
c56e9629
authored
Apr 07, 2019
by
Joe Haddad
Committed by
GitHub
Apr 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add lambda version of shared chunks (#6924)
* Add lambda version of shared chunks * Fix test on Windows
parent
31dc4549
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
chunk-graph-plugin.ts
packages/next/build/webpack/plugins/chunk-graph-plugin.ts
+9
-7
select-pages.test.js
test/unit/select-pages/select-pages.test.js
+4
-1
No files found.
packages/next/build/webpack/plugins/chunk-graph-plugin.ts
View file @
c56e9629
...
...
@@ -160,19 +160,21 @@ export class ChunkGraphPlugin implements Plugin {
}
})
const
getLambdaChunk
=
(
name
:
string
)
=>
name
.
includes
(
this
.
buildId
)
?
name
.
replace
(
new
RegExp
(
`
${
this
.
buildId
}
[\\/\\\\]`
),
''
)
.
replace
(
/
[
.
]
js$/
,
`.
${
this
.
buildId
}
.js`
)
:
name
for
(
const
page
in
pages
)
{
manifest
.
pages
[
page
]
=
[...
pages
[
page
],
...
sharedFiles
]
manifest
.
pageChunks
[
page
]
=
[
...
new
Set
([
...
pageChunks
[
page
],
...
pageChunks
[
page
].
map
(
name
=>
name
.
includes
(
this
.
buildId
)
?
name
.
replace
(
new
RegExp
(
`
${
this
.
buildId
}
[\\/\\\\]`
),
''
)
.
replace
(
/
[
.
]
js$/
,
`.
${
this
.
buildId
}
.js`
)
:
name
),
...
pageChunks
[
page
].
map
(
getLambdaChunk
),
...
sharedChunks
,
...
sharedChunks
.
map
(
getLambdaChunk
),
]),
].
sort
()
}
...
...
test/unit/select-pages/select-pages.test.js
View file @
c56e9629
/* eslint-env jest */
import
{
getSpecifiedPages
}
from
'next/dist/build'
import
{
getSpecifiedPages
as
_getSpecifiedPages
}
from
'next/dist/build'
const
getSpecifiedPages
=
async
(...
args
)
=>
(
await
_getSpecifiedPages
(...
args
)).
map
(
pg
=>
pg
.
replace
(
/
\\
+/g
,
'/'
))
describe
(
'getSpecifiedPages'
,
()
=>
{
it
(
'should only choose selected'
,
async
()
=>
{
...
...
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