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
5d13e55a
Unverified
Commit
5d13e55a
authored
Apr 23, 2020
by
JJ Kasper
Committed by
GitHub
Apr 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure modern AMP client page bundles are removed (#12138)
parent
0a3b64d2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
296 additions
and
188 deletions
+296
-188
index.ts
packages/next/build/index.ts
+11
-8
next.config.js
test/integration/amphtml/next.config.js
+1
-0
index.test.js
test/integration/amphtml/test/index.test.js
+284
-180
No files found.
packages/next/build/index.ts
View file @
5d13e55a
...
@@ -551,15 +551,18 @@ export default async function build(dir: string, conf = null): Promise<void> {
...
@@ -551,15 +551,18 @@ export default async function build(dir: string, conf = null): Promise<void> {
if
(
result
.
isAmpOnly
)
{
if
(
result
.
isAmpOnly
)
{
// ensure all AMP only bundles got removed
// ensure all AMP only bundles got removed
try
{
try
{
await
fsUnlink
(
const
clientBundle
=
path
.
join
(
path
.
join
(
distDir
,
distDir
,
'static'
,
'static'
,
buildId
,
buildId
,
'pages'
,
'pages'
,
actualPage
+
'.js'
actualPage
+
'.js'
)
)
)
await
fsUnlink
(
clientBundle
)
if
(
config
.
experimental
.
modern
)
{
await
fsUnlink
(
clientBundle
.
replace
(
/
\.
js$/
,
'.module.js'
))
}
}
catch
(
err
)
{
}
catch
(
err
)
{
if
(
err
.
code
!==
'ENOENT'
)
{
if
(
err
.
code
!==
'ENOENT'
)
{
throw
err
throw
err
...
...
test/integration/amphtml/next.config.js
View file @
5d13e55a
...
@@ -6,4 +6,5 @@ module.exports = {
...
@@ -6,4 +6,5 @@ module.exports = {
amp
:
{
amp
:
{
canonicalBase
:
'http://localhost:1234'
,
canonicalBase
:
'http://localhost:1234'
,
},
},
// edit here
}
}
test/integration/amphtml/test/index.test.js
View file @
5d13e55a
This diff is collapsed.
Click to expand it.
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