You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 18, 2024. It is now read-only.
Trying to use @neutrinojs/fork programmatically as webpack multi-compiler
Expected: Neutrino spitting out a list with 2 (or more) configs
Actual: Neutrino running two webpacks itself. This is not the same as multi-compiler.
Feature request or enhancement?
Webpack has the multi-compiler option, where you export a list of webpack configs and Webpack runs them all. The current implementation is that the fork package expects all settings for each of the configs upfront.
When using fork programmatically in my own preset, the middleware directly forks child processes. If I look at the unit tests for most other presets, it executes validations on the generated webpack config. Would it be possible to have a similar setup for fork? So drop the forking but just generate a list of webpack configs.
Some template code:
module.exports = (neutrino, opts = {}) => {
var site_config = hugo.loadHugoConfig()
neutrino.use('@neutrinojs/fork', [ callback1, callback2 ]
function callback1 (neutrino, opts = {}) {
// child neutrino generating the first config
}
function callback2 (neutrino, opts = {}) {
// child neutrino generating the second config
}
The parent neutrino.config.toConfig() would result in:
See #308 and #385 for some history here. Given the v8 architecture, it was very hard to make multiple configs a thing, and we landed on the fork middleware. I don't think it would be feasible to make the fork middleware do this.
Now, with #852 in progress, the fork middleware will go away, and it should be possible to return multiple configs for webpack. So yes, we want to support doing multiple builds, but not via the fork middleware.
Closing as a solution is in progress. Thank you for the issue!
@ringods, Hi! We've just released a Neutrino 9 beta, which makes it possible to export multiple configs from webpack.config.js - if you'd like to try it out? See #1129.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug or issue?
Please try to answer the following questions:
@neutrinojs/fork
programmatically as webpack multi-compilerFeature request or enhancement?
Webpack has the
multi-compiler
option, where you export a list of webpack configs and Webpack runs them all. The current implementation is that thefork
package expects all settings for each of the configs upfront.When using
fork
programmatically in my own preset, the middleware directly forks child processes. If I look at the unit tests for most other presets, it executes validations on the generated webpack config. Would it be possible to have a similar setup forfork
? So drop the forking but just generate a list of webpack configs.Some template code:
The parent
neutrino.config.toConfig()
would result in:before being passed on to Webpack as usual.
The text was updated successfully, but these errors were encountered: