Closed yovanoc closed 5 years ago
In your final build, the worker.js
file must remains separated as a single file. See if you can ignore that file from the build step and directly copy it into your destination folder.
that's not what I meant. I have to get a SINGLE final js build, not the js and the worker.js.
I hope you planned that
Hi @yovanoc,
thanks for reporting the issue and sorry for the late response. Currently, it's not possible to produce a single file build with microjob. However, this feature could be included in future releases.
I'm flagging this as a feature-request
👍
@wilk what do you think of using new Worker("executor_string", { eval: true })
? Is this a vialable solution for you?
The worker code would still stay in a separated file for best practice, but exported as string, so that the goal of a single file build will be achieved:
module.exports = `
const { parentPort } = require('worker_threads')
parentPort.on('message etc...
@manuel-di-iorio Yes, passing directly the blob should work. Would you like to submit a PR?
Blob does not work on nodejs, right?
Hello,
I'm working on a big project in typescript and microjob could help me a lot, I already implements the things I have to put on worker threads and it's a huge improvement while I'm testing this in dev mode.
But the problem is that the production mode is going through webpack to build a single final js file to run with node. But for microjob I see that we need this .js file in the node_modules.
So I ask if there is a way to concat files, or if you are considering this for futures versions?
Really good job and thanks for this lib otherwise