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
8f21c283
Unverified
Commit
8f21c283
authored
Jan 29, 2021
by
Janicklas Ralph
Committed by
GitHub
Jan 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experimental feature changes (#21646)
Adding test for experimental-serverless-trace + fix for the same
parent
08846cf8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletion
+24
-1
webpack-config.ts
packages/next/build/webpack-config.ts
+2
-1
next-server.ts
packages/next/next-server/server/next-server.ts
+2
-0
index.js
test/integration/critical-css/pages/index.js
+2
-0
index.test.js
test/integration/critical-css/test/index.test.js
+18
-0
No files found.
packages/next/build/webpack-config.ts
View file @
8f21c283
...
@@ -1013,7 +1013,7 @@ export default async function getBaseWebpackConfig(
...
@@ -1013,7 +1013,7 @@ export default async function getBaseWebpackConfig(
config
.
experimental
.
optimizeImages
config
.
experimental
.
optimizeImages
),
),
'process.env.__NEXT_OPTIMIZE_CSS'
:
JSON
.
stringify
(
'process.env.__NEXT_OPTIMIZE_CSS'
:
JSON
.
stringify
(
!!
config
.
experimental
.
optimizeCss
&&
!
dev
config
.
experimental
.
optimizeCss
&&
!
dev
),
),
'process.env.__NEXT_SCROLL_RESTORATION'
:
JSON
.
stringify
(
'process.env.__NEXT_SCROLL_RESTORATION'
:
JSON
.
stringify
(
config
.
experimental
.
scrollRestoration
config
.
experimental
.
scrollRestoration
...
@@ -1202,6 +1202,7 @@ export default async function getBaseWebpackConfig(
...
@@ -1202,6 +1202,7 @@ export default async function getBaseWebpackConfig(
reactMode
:
config
.
experimental
.
reactMode
,
reactMode
:
config
.
experimental
.
reactMode
,
optimizeFonts
:
config
.
experimental
.
optimizeFonts
,
optimizeFonts
:
config
.
experimental
.
optimizeFonts
,
optimizeImages
:
config
.
experimental
.
optimizeImages
,
optimizeImages
:
config
.
experimental
.
optimizeImages
,
optimizeCss
:
config
.
experimental
.
optimizeCss
,
scrollRestoration
:
config
.
experimental
.
scrollRestoration
,
scrollRestoration
:
config
.
experimental
.
scrollRestoration
,
basePath
:
config
.
basePath
,
basePath
:
config
.
basePath
,
pageEnv
:
config
.
experimental
.
pageEnv
,
pageEnv
:
config
.
experimental
.
pageEnv
,
...
...
packages/next/next-server/server/next-server.ts
View file @
8f21c283
...
@@ -1575,6 +1575,8 @@ export default class Server {
...
@@ -1575,6 +1575,8 @@ export default class Server {
locale
,
locale
,
locales
,
locales
,
defaultLocale
,
defaultLocale
,
optimizeCss
:
this
.
renderOpts
.
optimizeCss
,
distDir
:
this
.
distDir
,
fontManifest
:
this
.
renderOpts
.
fontManifest
,
fontManifest
:
this
.
renderOpts
.
fontManifest
,
domainLocales
:
this
.
renderOpts
.
domainLocales
,
domainLocales
:
this
.
renderOpts
.
domainLocales
,
}
}
...
...
test/integration/critical-css/pages/index.js
View file @
8f21c283
...
@@ -7,3 +7,5 @@ export default function Home() {
...
@@ -7,3 +7,5 @@ export default function Home() {
<
/div
>
<
/div
>
)
)
}
}
Home
.
getInitialProps
=
()
=>
({})
test/integration/critical-css/test/index.test.js
View file @
8f21c283
...
@@ -65,3 +65,21 @@ describe('CSS optimization for serverless apps', () => {
...
@@ -65,3 +65,21 @@ describe('CSS optimization for serverless apps', () => {
afterAll
(()
=>
killApp
(
app
))
afterAll
(()
=>
killApp
(
app
))
runTests
()
runTests
()
})
})
describe
(
'Font optimization for emulated serverless apps'
,
()
=>
{
beforeAll
(
async
()
=>
{
await
fs
.
writeFile
(
nextConfig
,
`module.exports = { target: 'experimental-serverless-trace', experimental: {optimizeCss: true} }`
,
'utf8'
)
await
nextBuild
(
appDir
)
appPort
=
await
findPort
()
app
=
await
nextStart
(
appDir
,
appPort
)
})
afterAll
(
async
()
=>
{
await
killApp
(
app
)
await
fs
.
remove
(
nextConfig
)
})
runTests
()
})
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