JetBrains / svg-sprite-loader

Webpack loader for creating SVG sprites.
MIT License
2.01k stars 272 forks source link

fix(utils): fix 'Properties descriptionData are unknown' with webpack5 #447

Closed rgiese closed 3 years ago

rgiese commented 3 years ago

Webpack5 as used by GatsbyJS gets cranky when the descriptionData attribute from assorted rules (like its stock JS processing) isn't consumed during a compile pass. Adding this rule plugin resolves this issue.

What kind of change does this PR introduce? (bugfix, feature, docs update, improvement)

Bugfix

What is the current behavior? (You can also link to an open issue here)

(e.g. in Gatsby:)

failed Building production JavaScript and CSS bundles - 0.362s

 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Compiling RuleSet failed: Properties descriptionData are unknown (at ruleSet[0].rules[0]: [object Object])

...for a ruleset like:

{
  test: /\.js$/i,
  descriptionData: { type: 'module' },
  resolve: { byDependency: { esm: [Object] } }
}

...which is valid when Webpack processes it with all its built-in rules but not when we're somewhat goofily using only parts of Webpack in get-matched-rule-5.js.

What is the new behavior (if this is a feature change)?

Everything passes.

Does this PR introduce a breaking change?

No.

Please check if the PR fulfills contributing guidelines

Yes.

rgiese commented 3 years ago

@d3x42 Gentle ping. :)