feat: add "enableDevServer" helper

This commit is contained in:
Christopher Willis-Ford 2024-03-18 11:09:52 -07:00
parent c1046e9a91
commit 44c77658ba

View file

@ -161,6 +161,23 @@ class ScratchWebpackConfigBuilder {
return this;
}
/**
* Enable the webpack dev server. Probably only useful for web targets.
* @param {string|number} [port='auto'] The port to listen on, or `'auto'` to use a random port.
* @returns {this}
*/
enableDevServer (port = 'auto') {
return this.merge({
devServer: {
client: {
overlay: true,
progress: true
},
port
}
});
}
/**
* Add a new rule to `module.rules` in the current configuration object.
* @param {RuleSetRule} rule The rule to add.