diff --git a/packages/core/core/src/public/MutableBundleGraph.js b/packages/core/core/src/public/MutableBundleGraph.js index f732d9409ec..7565db82c0a 100644 --- a/packages/core/core/src/public/MutableBundleGraph.js +++ b/packages/core/core/src/public/MutableBundleGraph.js @@ -120,7 +120,17 @@ export default class MutableBundleGraph resolvedNodeId, bundleGraphEdgeTypes.references, ); - this.#graph._graph.removeEdge(dependencyNodeId, resolvedNodeId); + if ( + // This check is needed for multiple targets, when we go over the same nodes twice + this.#graph._graph.hasEdge( + dependencyNodeId, + resolvedNodeId, + bundleGraphEdgeTypes.null, + ) + ) { + //nullEdgeType + this.#graph._graph.removeEdge(dependencyNodeId, resolvedNodeId); + } if (dependency.isEntry) { this.#graph._graph.addEdge( diff --git a/packages/core/integration-tests/test/integration/scss-html-import/fa-regular-400.ttf b/packages/core/integration-tests/test/integration/scss-html-import/fa-regular-400.ttf new file mode 100644 index 00000000000..d67c5c8ffa2 Binary files /dev/null and b/packages/core/integration-tests/test/integration/scss-html-import/fa-regular-400.ttf differ diff --git a/packages/core/integration-tests/test/integration/scss-html-import/package.json b/packages/core/integration-tests/test/integration/scss-html-import/package.json new file mode 100644 index 00000000000..9144bc55d8a --- /dev/null +++ b/packages/core/integration-tests/test/integration/scss-html-import/package.json @@ -0,0 +1,18 @@ +{ + "name": "scss-import-targets", + "private": true, + "targets": { + "target1": { + "source": [ + "./target1.html" + ], + "distDir": "./target1/" + }, + "target2": { + "source": [ + "./target2.html" + ], + "distDir": "./target2/" + } + } +} \ No newline at end of file diff --git a/packages/core/integration-tests/test/integration/scss-html-import/style.scss b/packages/core/integration-tests/test/integration/scss-html-import/style.scss new file mode 100644 index 00000000000..71485406dfb --- /dev/null +++ b/packages/core/integration-tests/test/integration/scss-html-import/style.scss @@ -0,0 +1,4 @@ +@font-face { + font-family: 'Font Awesome 6 Free'; + src: url('fa-regular-400.ttf') format('truetype'); +} diff --git a/packages/core/integration-tests/test/integration/scss-html-import/target1.html b/packages/core/integration-tests/test/integration/scss-html-import/target1.html new file mode 100644 index 00000000000..2c3c823a226 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scss-html-import/target1.html @@ -0,0 +1,8 @@ + + +
+