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({
reactRemoveProperties
:
jest
?
false
:
nextConfig
?.
compiler
?.
reactRemoveProperties
,
modularizeImports
:
nextConfig
?.
experimental
?.
modularizeImports
,
modularizeImports
:
nextConfig
?.
modularizeImports
,
relay
:
nextConfig
?.
compiler
?.
relay
,
// Always transform styled-jsx and error when `client-only` condition is triggered
styledJsx
:
true
,
...
...
packages/next/build/webpack-config.ts
View file @
7c8d0062
...
...
@@ -2155,6 +2155,7 @@ export default async function getBaseWebpackConfig(
!!
config
.
skipMiddlewareUrlNormalize
,
],
[
'skipTrailingSlashRedirect'
,
!!
config
.
skipTrailingSlashRedirect
],
[
'modularizeImports'
,
!!
config
.
modularizeImports
],
SWCBinaryTarget
,
].
filter
<
[
Feature
,
boolean
]
>
(
Boolean
as
any
)
)
...
...
@@ -2304,7 +2305,7 @@ export default async function getBaseWebpackConfig(
styledComponents
:
config
.
compiler
?.
styledComponents
,
relay
:
config
.
compiler
?.
relay
,
emotion
:
config
.
compiler
?.
emotion
,
modularizeImports
:
config
.
experimental
?.
modularizeImports
,
modularizeImports
:
config
.
modularizeImports
,
legacyBrowsers
:
config
.
experimental
?.
legacyBrowsers
,
imageLoaderFile
:
config
.
images
.
loaderFile
,
})
...
...
packages/next/build/webpack/plugins/telemetry-plugin.ts
View file @
7c8d0062
...
...
@@ -40,6 +40,7 @@ export type Feature =
|
'transpilePackages'
|
'skipMiddlewareUrlNormalize'
|
'skipTrailingSlashRedirect'
|
'modularizeImports'
interface
FeatureUsage
{
featureName
:
Feature
...
...
@@ -102,6 +103,7 @@ const BUILD_FEATURES: Array<Feature> = [
'transpilePackages'
,
'skipMiddlewareUrlNormalize'
,
'skipTrailingSlashRedirect'
,
'modularizeImports'
,
]
const
ELIMINATED_PACKAGES
=
new
Set
<
string
>
()
...
...
packages/next/server/config-schema.ts
View file @
7c8d0062
...
...
@@ -310,9 +310,6 @@ const configSchema = {
enum
:
[
'strict'
,
'flexible'
]
as
any
,
type
:
'string'
,
},
modularizeImports
:
{
type
:
'object'
,
},
newNextLinkBehavior
:
{
type
:
'boolean'
,
},
...
...
@@ -629,6 +626,9 @@ const configSchema = {
},
type
:
'object'
,
},
modularizeImports
:
{
type
:
'object'
,
},
onDemandEntries
:
{
additionalProperties
:
false
,
properties
:
{
...
...
packages/next/server/config-shared.ts
View file @
7c8d0062
...
...
@@ -120,14 +120,6 @@ export interface ExperimentalConfig {
urlImports
?:
NonNullable
<
webpack
.
Configuration
[
'experiments'
]
>
[
'buildHttp'
]
outputFileTracingRoot
?:
string
outputFileTracingIgnores
?:
string
[]
modularizeImports
?:
Record
<
string
,
{
transform
:
string
preventFullImport
?:
boolean
skipDefaultConversion
?:
boolean
}
>
swcTraceProfiling
?:
boolean
forceSwcTransforms
?:
boolean
...
...
@@ -508,6 +500,15 @@ export interface NextConfig extends Record<string, any> {
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.
*/
...
...
@@ -566,6 +567,7 @@ export const defaultConfig: NextConfig = {
staticPageGenerationTimeout
:
60
,
swcMinify
:
true
,
output
:
!!
process
.
env
.
NEXT_PRIVATE_STANDALONE
?
'standalone'
:
undefined
,
modularizeImports
:
undefined
,
experimental
:
{
fetchCache
:
false
,
middlewarePrefetch
:
'flexible'
,
...
...
@@ -608,7 +610,6 @@ export const defaultConfig: NextConfig = {
disablePostcssPresetEnv
:
undefined
,
amp
:
undefined
,
urlImports
:
undefined
,
modularizeImports
:
undefined
,
enableUndici
:
false
,
adjustFontFallbacks
:
false
,
adjustFontFallbacksWithSizeAdjust
:
false
,
...
...
packages/next/telemetry/events/build.ts
View file @
7c8d0062
...
...
@@ -169,6 +169,7 @@ export type EventBuildFeatureUsage = {
|
'transpilePackages'
|
'skipMiddlewareUrlNormalize'
|
'skipTrailingSlashRedirect'
|
'modularizeImports'
invocationCount
:
number
}
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