Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

Could you support new feature to allow us pass the webpack configuration object directly? #104

Open
tianyingchun opened this issue Sep 15, 2020 · 1 comment

Comments

@tianyingchun
Copy link

Could you support new feature to allow us pass the webpack configuration object directly?

for now

var run = require('parallel-webpack').run,
    configPath = require.resolve('./webpack.config.js');

run(configPath, {
    watch: false,
    maxRetries: 1,
    stats: true, // defaults to false
    maxConcurrentWorkers: 2 // use 2 workers
});

new feature is.

run({ .... webpack configuration here. }, {
    watch: false,
    maxRetries: 1,
    stats: true, // defaults to false
    maxConcurrentWorkers: 2 // use 2 workers
});
@jlurena
Copy link

jlurena commented Jan 4, 2021

@tianyingchun you can pass in a file that returns a callback function.

some-file.js
module.exports = () => { /** webpack configuration object /* } ;

then call it with

var run = require('parallel-webpack').run,
    configPath = require.resolve('some-file.js');

run(configPath, {
    watch: false,
    maxRetries: 1,
    stats: true, // defaults to false
    maxConcurrentWorkers: 2 // use 2 workers
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants