diff --git a/src/index.cjs b/src/index.cjs index e64c6da..f06660f 100644 --- a/src/index.cjs +++ b/src/index.cjs @@ -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.