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
e00e3c97
Unverified
Commit
e00e3c97
authored
May 10, 2021
by
JJ Kasper
Committed by
GitHub
May 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure webpack cache is invalidated for alias change (#24956)
parent
6d0150f0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
webpack-config.ts
packages/next/build/webpack-config.ts
+1
-0
next.config.js
test/integration/custom-routes/next.config.js
+1
-0
index.test.js
test/integration/custom-routes/test/index.test.js
+22
-1
No files found.
packages/next/build/webpack-config.ts
View file @
e00e3c97
...
@@ -1263,6 +1263,7 @@ export default async function getBaseWebpackConfig(
...
@@ -1263,6 +1263,7 @@ export default async function getBaseWebpackConfig(
target
,
target
,
reactProductionProfiling
,
reactProductionProfiling
,
webpack
:
!!
config
.
webpack
,
webpack
:
!!
config
.
webpack
,
hasRewrites
,
})
})
const
cache
:
any
=
{
const
cache
:
any
=
{
...
...
test/integration/custom-routes/next.config.js
View file @
e00e3c97
module
.
exports
=
{
module
.
exports
=
{
// target: 'serverless',
// target: 'serverless',
async
rewrites
()
{
async
rewrites
()
{
// no-rewrites comment
return
{
return
{
afterFiles
:
[
afterFiles
:
[
...(
process
.
env
.
ADD_NOOP_REWRITE
===
'true'
...(
process
.
env
.
ADD_NOOP_REWRITE
===
'true'
...
...
test/integration/custom-routes/test/index.test.js
View file @
e00e3c97
...
@@ -1731,12 +1731,33 @@ describe('Custom routes', () => {
...
@@ -1731,12 +1731,33 @@ describe('Custom routes', () => {
})
})
describe
(
'dev mode'
,
()
=>
{
describe
(
'dev mode'
,
()
=>
{
let
nextConfigContent
beforeAll
(
async
()
=>
{
beforeAll
(
async
()
=>
{
// ensure cache with rewrites disabled doesn't persist
// after enabling rewrites
await
fs
.
remove
(
join
(
appDir
,
'.next'
))
nextConfigContent
=
await
fs
.
readFile
(
nextConfigPath
,
'utf8'
)
await
fs
.
writeFile
(
nextConfigPath
,
nextConfigContent
.
replace
(
'// no-rewrites comment'
,
'return []'
)
)
const
tempPort
=
await
findPort
()
const
tempApp
=
await
launchApp
(
appDir
,
tempPort
)
await
renderViaHTTP
(
tempPort
,
'/'
)
await
killApp
(
tempApp
)
await
fs
.
writeFile
(
nextConfigPath
,
nextConfigContent
)
appPort
=
await
findPort
()
appPort
=
await
findPort
()
app
=
await
launchApp
(
appDir
,
appPort
)
app
=
await
launchApp
(
appDir
,
appPort
)
buildId
=
'development'
buildId
=
'development'
})
})
afterAll
(()
=>
killApp
(
app
))
afterAll
(
async
()
=>
{
await
fs
.
writeFile
(
nextConfigPath
,
nextConfigContent
)
await
killApp
(
app
)
})
runTests
(
true
)
runTests
(
true
)
})
})
...
...
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