Skip to content

Commit 44c7765

Browse files
committed
feat: add "enableDevServer" helper
1 parent c1046e9 commit 44c7765

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/index.cjs

+17
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,23 @@ class ScratchWebpackConfigBuilder {
161161
return this;
162162
}
163163

164+
/**
165+
* Enable the webpack dev server. Probably only useful for web targets.
166+
* @param {string|number} [port='auto'] The port to listen on, or `'auto'` to use a random port.
167+
* @returns {this}
168+
*/
169+
enableDevServer (port = 'auto') {
170+
return this.merge({
171+
devServer: {
172+
client: {
173+
overlay: true,
174+
progress: true
175+
},
176+
port
177+
}
178+
});
179+
}
180+
164181
/**
165182
* Add a new rule to `module.rules` in the current configuration object.
166183
* @param {RuleSetRule} rule The rule to add.

0 commit comments

Comments
 (0)