mirror of
https://github.com/scratchfoundation/scratch-webpack-configuration.git
synced 2024-11-24 08:38:04 -05:00
feat: add "enableDevServer" helper
This commit is contained in:
parent
c1046e9a91
commit
44c77658ba
1 changed files with 17 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue