Skip to content

Commit

Permalink
add telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding committed Dec 21, 2022
1 parent c3c6125 commit 277f91f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/next/build/webpack-config.ts
Expand Up @@ -2155,6 +2155,7 @@ export default async function getBaseWebpackConfig(
!!config.skipMiddlewareUrlNormalize,
],
['skipTrailingSlashRedirect', !!config.skipTrailingSlashRedirect],
['modularizeImports', !!config.modularizeImports],
SWCBinaryTarget,
].filter<[Feature, boolean]>(Boolean as any)
)
Expand Down
2 changes: 2 additions & 0 deletions packages/next/build/webpack/plugins/telemetry-plugin.ts
Expand Up @@ -40,6 +40,7 @@ export type Feature =
| 'transpilePackages'
| 'skipMiddlewareUrlNormalize'
| 'skipTrailingSlashRedirect'
| 'modularizeImports'

interface FeatureUsage {
featureName: Feature
Expand Down Expand Up @@ -102,6 +103,7 @@ const BUILD_FEATURES: Array<Feature> = [
'transpilePackages',
'skipMiddlewareUrlNormalize',
'skipTrailingSlashRedirect',
'modularizeImports',
]

const ELIMINATED_PACKAGES = new Set<string>()
Expand Down
1 change: 1 addition & 0 deletions packages/next/telemetry/events/build.ts
Expand Up @@ -169,6 +169,7 @@ export type EventBuildFeatureUsage = {
| 'transpilePackages'
| 'skipMiddlewareUrlNormalize'
| 'skipTrailingSlashRedirect'
| 'modularizeImports'
invocationCount: number
}
export function eventBuildFeatureUsage(
Expand Down

0 comments on commit 277f91f

Please sign in to comment.