Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tracing to collect from reasons #29975

Merged
merged 9 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ export const NODE_BASE_ESM_RESOLVE_OPTIONS = {

let TSCONFIG_WARNED = false

export const nextImageLoaderRegex =
ijjk marked this conversation as resolved.
Show resolved Hide resolved
/\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i

export default async function getBaseWebpackConfig(
dir: string,
{
Expand Down Expand Up @@ -1057,7 +1060,7 @@ export default async function getBaseWebpackConfig(
...(!config.images.disableStaticImages
? [
{
test: /\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i,
test: nextImageLoaderRegex,
loader: 'next-image-loader',
issuer: { not: regexLikeCss },
dependency: { not: ['url'] },
Expand Down Expand Up @@ -1199,6 +1202,8 @@ export default async function getBaseWebpackConfig(
!dev &&
new TraceEntryPointsPlugin({
appDir: dir,
esmExternals: config.experimental.esmExternals,
staticImageImports: !config.images.disableStaticImages,
}),
// Moment.js is an extremely popular library that bundles large locale files
// by default due to how Webpack interprets its code. This is a practical
Expand Down
3 changes: 2 additions & 1 deletion packages/next/build/webpack/config/blocks/images/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import curry from 'next/dist/compiled/lodash.curry'
import { webpack } from 'next/dist/compiled/webpack/webpack'
import { nextImageLoaderRegex } from '../../../../webpack-config'
import { loader } from '../../helpers'
import { ConfigurationContext, ConfigurationFn, pipe } from '../../utils'
import { getCustomDocumentImageError } from './messages'
Expand All @@ -12,7 +13,7 @@ export const images = curry(async function images(
loader({
oneOf: [
{
test: /\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i,
test: nextImageLoaderRegex,
use: {
loader: 'error-loader',
options: {
Expand Down
Loading