Closed vwochnik closed 8 years ago
+1!
It also causes an issue with the require syntax if two files are built in parallel. The two instances will share the includedFiles
variable and required files are only included into the first file even though all instances are completely independent and shouldn't be sharing this variable.
If a proper rewrite with functions that don't access the global scope is too much work for you, I recommend wrapping everything with a function and exporting that function. The global variables will then be specific to the function call they originated from.
Sorry for the late reaction. I'll look into this asap, shouldn't be a huge fix. I have patched similar issues before, but never considered parallel building.
Solved in 2.3.1, let me know if you have any issues.
The variables used by this plugin are not scoped properly, i.e. encapsulated in an IIFE, such that when two instances of
include
run in parallel with differentincludePaths
for instance, it's getting very messy.For now, am reloading the module for each successive call: