Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nx-plugin): assert test property is defined on webpack rule in nx…
…-react-webpack-plugin The `removeSvgLoaderIfPresent` method in `apply-react-config.ts` iterates through each Webpack rule, calls `toString` on each `test` property, and checks for the presence of the string `"svg"` to see if any existing SVG plugins need to be removed. Some of the Webpack rules in the config don't have the test property, and calling `toString` without asserting the test property is defined first throws type errors. This commit introduces a very small change that simply asserts that `rule.test` is not `undefined` before calling `.toString()`.
- Loading branch information