Skip to content

Commit 8699a5b

Browse files
committed
chore: update PR based on peer review
Signed-off-by: Jeremy Long <[email protected]>
1 parent 55425ed commit 8699a5b

File tree

5 files changed

+310
-245
lines changed

5 files changed

+310
-245
lines changed

src/plugin.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,13 @@ export class CycloneDxWebpackPlugin {
319319
#addRootComponentExtRefs (component: CDX.Models.Component | undefined, logger: WebpackLogger): void {
320320
if (component === undefined) { return }
321321
if (typeof this.rootComponentBuildSystem === 'string' && this.rootComponentBuildSystem.length > 0) {
322-
const buildSystemRef = new CDX.Models.ExternalReference(this.rootComponentBuildSystem, CDX.Enums.ExternalReferenceType.BuildSystem)
323-
component.externalReferences.add(buildSystemRef)
322+
component.externalReferences.add(
323+
new CDX.Models.ExternalReference(
324+
this.rootComponentBuildSystem,
325+
CDX.Enums.ExternalReferenceType.BuildSystem,
326+
{ comment: 'as declared via cyclonedx-webpack-plugin config "rootComponentBuildSystem"' }
327+
)
328+
)
324329
logger.debug('Added build system URL:', this.rootComponentBuildSystem)
325330
}
326331
}

tests/integration/__snapshots__/index.test.js.snap

Lines changed: 301 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)