pietroppeter / nimib

nimib 🐳 - nim 👑 driven ⛵ publishing ✍
https://pietroppeter.github.io/nimib/
MIT License
181 stars 10 forks source link

Handle multiple documents being built in parallel #164

Closed HugoGranstrom closed 1 year ago

HugoGranstrom commented 1 year ago

When working with the async in nimiBook today, I stumbled upon a bug. In nbJs we write our nim code to unique filenames, but the output of the all is temp/nimib/out.js. So if multiple documents are compiling their nbJs at the same time, they will clash with each other. So we create a unique output filename as well. I'm thinking of doing something like:

let outfile = &"out{hash(doc.thisFile)}.js"

so we are sure that no two documents will have the same filename.