Skip to content

Commit ba2993f

Browse files
refactor: remove the features option (#2410)
BREAKING CHANGE: the `features` option was remove without alternatives
1 parent 036fa17 commit ba2993f

File tree

4 files changed

+1
-18
lines changed

4 files changed

+1
-18
lines changed

lib/Server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ class Server {
557557
runnableFeatures.push('after');
558558
}
559559

560-
(this.options.features || runnableFeatures).forEach((feature) => {
560+
runnableFeatures.forEach((feature) => {
561561
features[feature]();
562562
});
563563
}

lib/options.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@
6868
"disableHostCheck": {
6969
"type": "boolean"
7070
},
71-
"features": {
72-
"type": "array",
73-
"items": {
74-
"type": "string"
75-
}
76-
},
7771
"filename": {
7872
"anyOf": [
7973
{
@@ -424,7 +418,6 @@
424418
"compress": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devservercompress)",
425419
"contentBase": "should be {Number|String|Array} (https://webpack.js.org/configuration/dev-server/#devservercontentbase)",
426420
"disableHostCheck": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck)",
427-
"features": "should be {Array}",
428421
"filename": "should be {String|RegExp|Function} (https://webpack.js.org/configuration/dev-server/#devserverfilename-)",
429422
"fs": "should be {Object} (https://github.com/webpack/webpack-dev-middleware#fs)",
430423
"headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserverheaders-)",

test/__snapshots__/validate-options.test.js.snap

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ exports[`options should throw an error on the "disableHostCheck" option with ""
8282
- options.disableHostCheck should be a boolean."
8383
`;
8484

85-
exports[`options should throw an error on the "features" option with "false" value 1`] = `
86-
"Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
87-
- options.features should be an array:
88-
[string, ...]"
89-
`;
90-
9185
exports[`options should throw an error on the "filename" option with "false" value 1`] = `
9286
"Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
9387
- options.filename should be one of these:

test/validate-options.test.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ describe('options', () => {
6767
success: [true],
6868
failure: [''],
6969
},
70-
features: {
71-
success: [['before'], []],
72-
failure: [false],
73-
},
7470
filename: {
7571
success: ['', new RegExp(''), () => {}],
7672
failure: [false],

0 commit comments

Comments
 (0)