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 {
// static image imports, CSS imports
file = nodePath.join(this.tracingRoot, 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 (
!isAsset &&
......
import fs from 'fs'
import path from 'path'
import data from '../../static/hello.json'
import css from '../../components/logo/logo.module.css'
export default (req, res) => {
console.log({
importedData: data,
importedData: css,
fsLoadedData: fs.readFileSync(
path.join(process.cwd(), 'static', 'hello.json'),
path.join(process.cwd(), 'components', 'logo', 'logo.module.css'),
'utf8'
),
})
......
......@@ -225,7 +225,7 @@ describe('Production Usage', () => {
},
{
page: '/api',
tests: [/webpack-runtime\.js/, /static\/hello\.json/],
tests: [/webpack-runtime\.js/, /\/logo\.module\.css/],
notTests: [
/next\/dist\/server\/next\.js/,
/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