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
7c8d0062
Unverified
Commit
7c8d0062
authored
Dec 21, 2022
by
Shu Ding
Committed by
GitHub
Dec 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move `modularizeImports` out of experimental (#44240)
parent
9ee4c0cd
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
14 deletions
+19
-14
options.js
packages/next/build/swc/options.js
+1
-1
webpack-config.ts
packages/next/build/webpack-config.ts
+2
-1
telemetry-plugin.ts
packages/next/build/webpack/plugins/telemetry-plugin.ts
+2
-0
config-schema.ts
packages/next/server/config-schema.ts
+3
-3
config-shared.ts
packages/next/server/config-shared.ts
+10
-9
build.ts
packages/next/telemetry/events/build.ts
+1
-0
No files found.
packages/next/build/swc/options.js
View file @
7c8d0062
...
@@ -115,7 +115,7 @@ function getBaseSWCOptions({
...
@@ -115,7 +115,7 @@ function getBaseSWCOptions({
reactRemoveProperties
:
jest
reactRemoveProperties
:
jest
?
false
?
false
:
nextConfig
?.
compiler
?.
reactRemoveProperties
,
:
nextConfig
?.
compiler
?.
reactRemoveProperties
,
modularizeImports
:
nextConfig
?.
experimental
?.
modularizeImports
,
modularizeImports
:
nextConfig
?.
modularizeImports
,
relay
:
nextConfig
?.
compiler
?.
relay
,
relay
:
nextConfig
?.
compiler
?.
relay
,
// Always transform styled-jsx and error when `client-only` condition is triggered
// Always transform styled-jsx and error when `client-only` condition is triggered
styledJsx
:
true
,
styledJsx
:
true
,
...
...
packages/next/build/webpack-config.ts
View file @
7c8d0062
...
@@ -2155,6 +2155,7 @@ export default async function getBaseWebpackConfig(
...
@@ -2155,6 +2155,7 @@ export default async function getBaseWebpackConfig(
!!
config
.
skipMiddlewareUrlNormalize
,
!!
config
.
skipMiddlewareUrlNormalize
,
],
],
[
'skipTrailingSlashRedirect'
,
!!
config
.
skipTrailingSlashRedirect
],
[
'skipTrailingSlashRedirect'
,
!!
config
.
skipTrailingSlashRedirect
],
[
'modularizeImports'
,
!!
config
.
modularizeImports
],
SWCBinaryTarget
,
SWCBinaryTarget
,
].
filter
<
[
Feature
,
boolean
]
>
(
Boolean
as
any
)
].
filter
<
[
Feature
,
boolean
]
>
(
Boolean
as
any
)
)
)
...
@@ -2304,7 +2305,7 @@ export default async function getBaseWebpackConfig(
...
@@ -2304,7 +2305,7 @@ export default async function getBaseWebpackConfig(
styledComponents
:
config
.
compiler
?.
styledComponents
,
styledComponents
:
config
.
compiler
?.
styledComponents
,
relay
:
config
.
compiler
?.
relay
,
relay
:
config
.
compiler
?.
relay
,
emotion
:
config
.
compiler
?.
emotion
,
emotion
:
config
.
compiler
?.
emotion
,
modularizeImports
:
config
.
experimental
?.
modularizeImports
,
modularizeImports
:
config
.
modularizeImports
,
legacyBrowsers
:
config
.
experimental
?.
legacyBrowsers
,
legacyBrowsers
:
config
.
experimental
?.
legacyBrowsers
,
imageLoaderFile
:
config
.
images
.
loaderFile
,
imageLoaderFile
:
config
.
images
.
loaderFile
,
})
})
...
...
packages/next/build/webpack/plugins/telemetry-plugin.ts
View file @
7c8d0062
...
@@ -40,6 +40,7 @@ export type Feature =
...
@@ -40,6 +40,7 @@ export type Feature =
|
'transpilePackages'
|
'transpilePackages'
|
'skipMiddlewareUrlNormalize'
|
'skipMiddlewareUrlNormalize'
|
'skipTrailingSlashRedirect'
|
'skipTrailingSlashRedirect'
|
'modularizeImports'
interface
FeatureUsage
{
interface
FeatureUsage
{
featureName
:
Feature
featureName
:
Feature
...
@@ -102,6 +103,7 @@ const BUILD_FEATURES: Array<Feature> = [
...
@@ -102,6 +103,7 @@ const BUILD_FEATURES: Array<Feature> = [
'transpilePackages'
,
'transpilePackages'
,
'skipMiddlewareUrlNormalize'
,
'skipMiddlewareUrlNormalize'
,
'skipTrailingSlashRedirect'
,
'skipTrailingSlashRedirect'
,
'modularizeImports'
,
]
]
const
ELIMINATED_PACKAGES
=
new
Set
<
string
>
()
const
ELIMINATED_PACKAGES
=
new
Set
<
string
>
()
...
...
packages/next/server/config-schema.ts
View file @
7c8d0062
...
@@ -310,9 +310,6 @@ const configSchema = {
...
@@ -310,9 +310,6 @@ const configSchema = {
enum
:
[
'strict'
,
'flexible'
]
as
any
,
enum
:
[
'strict'
,
'flexible'
]
as
any
,
type
:
'string'
,
type
:
'string'
,
},
},
modularizeImports
:
{
type
:
'object'
,
},
newNextLinkBehavior
:
{
newNextLinkBehavior
:
{
type
:
'boolean'
,
type
:
'boolean'
,
},
},
...
@@ -629,6 +626,9 @@ const configSchema = {
...
@@ -629,6 +626,9 @@ const configSchema = {
},
},
type
:
'object'
,
type
:
'object'
,
},
},
modularizeImports
:
{
type
:
'object'
,
},
onDemandEntries
:
{
onDemandEntries
:
{
additionalProperties
:
false
,
additionalProperties
:
false
,
properties
:
{
properties
:
{
...
...
packages/next/server/config-shared.ts
View file @
7c8d0062
...
@@ -120,14 +120,6 @@ export interface ExperimentalConfig {
...
@@ -120,14 +120,6 @@ export interface ExperimentalConfig {
urlImports
?:
NonNullable
<
webpack
.
Configuration
[
'experiments'
]
>
[
'buildHttp'
]
urlImports
?:
NonNullable
<
webpack
.
Configuration
[
'experiments'
]
>
[
'buildHttp'
]
outputFileTracingRoot
?:
string
outputFileTracingRoot
?:
string
outputFileTracingIgnores
?:
string
[]
outputFileTracingIgnores
?:
string
[]
modularizeImports
?:
Record
<
string
,
{
transform
:
string
preventFullImport
?:
boolean
skipDefaultConversion
?:
boolean
}
>
swcTraceProfiling
?:
boolean
swcTraceProfiling
?:
boolean
forceSwcTransforms
?:
boolean
forceSwcTransforms
?:
boolean
...
@@ -508,6 +500,15 @@ export interface NextConfig extends Record<string, any> {
...
@@ -508,6 +500,15 @@ export interface NextConfig extends Record<string, any> {
skipTrailingSlashRedirect
?:
boolean
skipTrailingSlashRedirect
?:
boolean
modularizeImports
?:
Record
<
string
,
{
transform
:
string
preventFullImport
?:
boolean
skipDefaultConversion
?:
boolean
}
>
/**
/**
* Enable experimental features. Note that all experimental features are subject to breaking changes in the future.
* Enable experimental features. Note that all experimental features are subject to breaking changes in the future.
*/
*/
...
@@ -566,6 +567,7 @@ export const defaultConfig: NextConfig = {
...
@@ -566,6 +567,7 @@ export const defaultConfig: NextConfig = {
staticPageGenerationTimeout
:
60
,
staticPageGenerationTimeout
:
60
,
swcMinify
:
true
,
swcMinify
:
true
,
output
:
!!
process
.
env
.
NEXT_PRIVATE_STANDALONE
?
'standalone'
:
undefined
,
output
:
!!
process
.
env
.
NEXT_PRIVATE_STANDALONE
?
'standalone'
:
undefined
,
modularizeImports
:
undefined
,
experimental
:
{
experimental
:
{
fetchCache
:
false
,
fetchCache
:
false
,
middlewarePrefetch
:
'flexible'
,
middlewarePrefetch
:
'flexible'
,
...
@@ -608,7 +610,6 @@ export const defaultConfig: NextConfig = {
...
@@ -608,7 +610,6 @@ export const defaultConfig: NextConfig = {
disablePostcssPresetEnv
:
undefined
,
disablePostcssPresetEnv
:
undefined
,
amp
:
undefined
,
amp
:
undefined
,
urlImports
:
undefined
,
urlImports
:
undefined
,
modularizeImports
:
undefined
,
enableUndici
:
false
,
enableUndici
:
false
,
adjustFontFallbacks
:
false
,
adjustFontFallbacks
:
false
,
adjustFontFallbacksWithSizeAdjust
:
false
,
adjustFontFallbacksWithSizeAdjust
:
false
,
...
...
packages/next/telemetry/events/build.ts
View file @
7c8d0062
...
@@ -169,6 +169,7 @@ export type EventBuildFeatureUsage = {
...
@@ -169,6 +169,7 @@ export type EventBuildFeatureUsage = {
|
'transpilePackages'
|
'transpilePackages'
|
'skipMiddlewareUrlNormalize'
|
'skipMiddlewareUrlNormalize'
|
'skipTrailingSlashRedirect'
|
'skipTrailingSlashRedirect'
|
'modularizeImports'
invocationCount
:
number
invocationCount
:
number
}
}
export
function
eventBuildFeatureUsage
(
export
function
eventBuildFeatureUsage
(
...
...
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