Skip to content

Commit

Permalink
chore(build): remove injecting fast refresh to custom loader logs (ve…
Browse files Browse the repository at this point in the history
…rcel#72870)

## Why?

Removing a log that holds very little meaning these days.


![cleanshot_2024-11-03_at_09.13.12_2x.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/FEMDaE9e61ZMCiJM0S0I/ef9c17a7-4fd1-4c70-94c3-c2b31f10c357.png)

Co-authored-by: JJ Kasper <[email protected]>
  • Loading branch information
samcx and ijjk authored Nov 18, 2024
1 parent a6c1005 commit 9a591a0
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,12 @@ export function attachReactRefresh(
webpackConfig: webpack.Configuration,
targetLoader: webpack.RuleSetUseItem
) {
let injections = 0
const reactRefreshLoader = require.resolve(reactRefreshLoaderName)
webpackConfig.module?.rules?.forEach((rule) => {
if (rule && typeof rule === 'object' && 'use' in rule) {
const curr = rule.use
// When the user has configured `defaultLoaders.babel` for a input file:
if (curr === targetLoader) {
++injections
rule.use = [reactRefreshLoader, curr as webpack.RuleSetUseItem]
} else if (
Array.isArray(curr) &&
Expand All @@ -189,7 +187,6 @@ export function attachReactRefresh(
(r) => r === reactRefreshLoader || r === reactRefreshLoaderName
)
) {
++injections
const idx = curr.findIndex((r) => r === targetLoader)
// Clone to not mutate user input
rule.use = [...curr]
Expand All @@ -199,14 +196,6 @@ export function attachReactRefresh(
}
}
})

if (injections) {
Log.info(
`automatically enabled Fast Refresh for ${injections} custom loader${
injections > 1 ? 's' : ''
}`
)
}
}

export const NODE_RESOLVE_OPTIONS = {
Expand Down

0 comments on commit 9a591a0

Please sign in to comment.