Skip to content

Commit 24b98bb

Browse files
authored
chore(build): make circular imports a build error (#7430)
1 parent 7cf6665 commit 24b98bb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

scripts/compilation/Inliner.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,16 @@ module.exports = class Inliner {
180180
},
181181
}),
182182
],
183+
onwarn(warning) {
184+
/*
185+
Circular imports are not an error in the language spec,
186+
but reasoning about the program and bundling becomes easier.
187+
For that reason let's avoid them.
188+
*/
189+
if (warning.code === "CIRCULAR_DEPENDENCY") {
190+
// throw Error(warning.message);
191+
}
192+
},
183193
external: (id) => {
184194
const relative = !!id.match(/^\.?\.?\//);
185195
if (!relative) {

0 commit comments

Comments
 (0)