Skip to content

Commit

Permalink
chore: add comments for polyfill imports and file paths (vercel#70233)
Browse files Browse the repository at this point in the history
### Why?

As the file paths to the build outputs of `@next/polyfill-module` &
`@next/polyfill-nomodule` may not be intuitive without context, added
comments that describes it.
  • Loading branch information
devjiwonchoi authored Sep 19, 2024
1 parent de47568 commit 48e3c14
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/next/src/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,7 @@ export default async function getBaseWebpackConfig(
new WellKnownErrorsPlugin(),
isClient &&
new CopyFilePlugin({
// file path to build output of `@next/polyfill-nomodule`
filePath: require.resolve('./polyfills/polyfill-nomodule'),
cacheKey: process.env.__NEXT_VERSION as string,
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
Expand Down
1 change: 1 addition & 0 deletions packages/next/src/client/app-index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// imports polyfill from `@next/polyfill-module` after build.
import '../build/polyfills/polyfill-module'
import ReactDOMClient from 'react-dom/client'
import React, { use } from 'react'
Expand Down
1 change: 1 addition & 0 deletions packages/next/src/client/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global location */
// imports polyfill from `@next/polyfill-module` after build.
import '../build/polyfills/polyfill-module'

import type Router from '../shared/lib/router/router'
Expand Down

0 comments on commit 48e3c14

Please sign in to comment.