mirror of
https://github.com/scratchfoundation/scratch-webpack-configuration.git
synced 2025-02-17 11:00:26 -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;
|
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.
|
* Add a new rule to `module.rules` in the current configuration object.
|
||||||
* @param {RuleSetRule} rule The rule to add.
|
* @param {RuleSetRule} rule The rule to add.
|
||||||
|
|
Loading…
Reference in a new issue