-
Notifications
You must be signed in to change notification settings - Fork 96
config instead of configPath #83
Comments
@SassNinja Let me know if you find something useful. I'm looking for the same as you. That will allow to dynamically create configs to build or make the things even simpler. |
Sure if I find something I'll let you know. So far the only possibility that comes into my mind is emitting my dynamic configs as files (using node's fs), starting parallel-webpack and then removing the config files again. But this feels like a bad workaround and would take away the performance benefit. |
The problem here is passing complex objects (i.e. instances of classes - Webpack Plugins) to another process. Even if you change the core of Webpack's config objects can't be serialized and node doesn't have threads which is why we're using forked processes and those don't have access to their parent processes context. Let me know if you do find a solution though. That'd be very interesting. I think there was some rather new library from Microsoft for multi-threading in node. Don't know if it'd work for this use case though. Note: I'll mark this as "wontfix" since I don't think it can be fixed. If you do find a way, I'd love to integrate it. |
Hi @SassNinja / anybody else trying to do this... I ended up changing my architecture... Instead of the main script (which calls Hope this helps |
Hi, I know it's been a while, but I was facing the same problem. The documentation says the following:
Then I looked up to the worker-farm docs and found out that it accepts the following options: {
workerOptions : {}
, maxCallsPerWorker : Infinity
, maxConcurrentWorkers : require('os').cpus().length
, maxConcurrentCallsPerWorker : 10
, maxConcurrentCalls : Infinity
, maxCallTime : Infinity
, maxRetries : Infinity
, autoStart : false
, onChild : function() {}
} The workeOptions is the most interesting one. It allows you to customize all the parameters passed to child nodes. But when I tried o do so nothing went through. Looking at the parallel-webpack source I saw the My question is why? If we could have these options available we could be able to pass some options down to the children, or am I missing something? Merry Christmas ✨ |
same need + 1 . Can I pass config to parallel-webpack intead of config path? |
Explain the problem
I build webpack configs dynamically based on user interaction (terminal prompt).
I can't and I don't wanna place each config as actual file in the project.
To build them all at once I put them in an array and use webpack's node api like this
But when I try the same with webpack-parallel it throws an error
Same with
parallelWebpack.run()
I've found #11 which seems to refer to this problem but is now more than a year old.
Is there still no chance to use configs with parallel-webpack instead of configPaths?
If no I've to do without the performance benefits :/
Expected Behaviour
Behave similar to webpack's api
Actual Behaviour
Does not support configs as param
Steps to reproduce
Try to run parallel node api with configs as param
Provide your webpack config
Provide your Environment details
Node version: v8.11.3
Operating System: Mac OS X
webpack version: 4.16.4
parallel-webpack version: 2.3.0
The text was updated successfully, but these errors were encountered: