Unverified Commit a2accb22 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update trace ignore check to check reasons correctly (#35511)

parent c2619247
...@@ -365,7 +365,9 @@ export class TraceEntryPointsPlugin implements webpack5.WebpackPluginInstance { ...@@ -365,7 +365,9 @@ export class TraceEntryPointsPlugin implements webpack5.WebpackPluginInstance {
// static image imports, CSS imports // static image imports, CSS imports
file = nodePath.join(this.tracingRoot, file) file = nodePath.join(this.tracingRoot, file)
const depMod = depModMap.get(file) const depMod = depModMap.get(file)
const isAsset = reasons.get(file)?.type.includes('asset') const isAsset = reasons
.get(nodePath.relative(this.tracingRoot, file))
?.type.includes('asset')
return ( return (
!isAsset && !isAsset &&
......
import fs from 'fs' import fs from 'fs'
import path from 'path' import path from 'path'
import data from '../../static/hello.json' import css from '../../components/logo/logo.module.css'
export default (req, res) => { export default (req, res) => {
console.log({ console.log({
importedData: data, importedData: css,
fsLoadedData: fs.readFileSync( fsLoadedData: fs.readFileSync(
path.join(process.cwd(), 'static', 'hello.json'), path.join(process.cwd(), 'components', 'logo', 'logo.module.css'),
'utf8' 'utf8'
), ),
}) })
......
...@@ -225,7 +225,7 @@ describe('Production Usage', () => { ...@@ -225,7 +225,7 @@ describe('Production Usage', () => {
}, },
{ {
page: '/api', page: '/api',
tests: [/webpack-runtime\.js/, /static\/hello\.json/], tests: [/webpack-runtime\.js/, /\/logo\.module\.css/],
notTests: [ notTests: [
/next\/dist\/server\/next\.js/, /next\/dist\/server\/next\.js/,
/next\/dist\/bin/, /next\/dist\/bin/,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment