Skip to content

Commit

Permalink
chore: reduce Webpack log noise due to missing source maps in externa…
Browse files Browse the repository at this point in the history
…l deps (#6793)
  • Loading branch information
gluxon committed May 13, 2024
1 parent 3568b75 commit 03b304f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion packages/webpack-build-scripts/webpack.config.base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,18 @@ export default {
rules: [
{
test: /\.js$/,
use: fileURLToPath(import.meta.resolve("source-map-loader")),
loader: fileURLToPath(import.meta.resolve("source-map-loader")),
options: {
filterSourceMappingUrl: (_url, resourcePath) => {
// These external modules (e.g. parse5) contain #sourceMappingUrl comments that point towards
// non-existent files. Skip them to reduce Webpack noise.
if (/\/node_modules\/(parse5|parse5-htmlparser2-tree-adapter)\//i.test(resourcePath)) {
return "skip";
}

return true;
},
},
},
{
test: /\.tsx?$/,
Expand Down
13 changes: 12 additions & 1 deletion packages/webpack-build-scripts/webpack.config.karma.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,18 @@ export default {
rules: [
{
test: /\.js$/,
use: fileURLToPath(import.meta.resolve("source-map-loader")),
loader: fileURLToPath(import.meta.resolve("source-map-loader")),
options: {
filterSourceMappingUrl: (_url, resourcePath) => {
// These external modules (e.g. parse5) contain #sourceMappingUrl comments that point towards
// non-existent files. Skip them to reduce Webpack noise.
if (/\/node_modules\/(parse5|parse5-htmlparser2-tree-adapter)\//i.test(resourcePath)) {
return "skip";
}

return true;
},
},
},
{
test: /\.tsx?$/,
Expand Down

1 comment on commit 03b304f

@svc-palantir-github
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chore: reduce Webpack log noise due to missing source maps in external deps (#6793)

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Please sign in to comment.