Skip to content

Commit 085813e

Browse files
committed
fix: remove lazy and filename options
1 parent 5e183c0 commit 085813e

18 files changed

+4
-290
lines changed

bin/cli-flags.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ module.exports = {
1414
type: Boolean,
1515
describe: 'Broadcasts the server via ZeroConf networking on start',
1616
},
17-
{
18-
name: 'lazy',
19-
type: Boolean,
20-
describe: 'Lazy',
21-
},
2217
{
2318
name: 'liveReload',
2419
type: Boolean,

bin/options.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ const options = {
1616
type: 'boolean',
1717
describe: 'Broadcasts the server via ZeroConf networking on start',
1818
},
19-
lazy: {
20-
type: 'boolean',
21-
describe: 'Lazy',
22-
},
2319
liveReload: {
2420
type: 'boolean',
2521
describe: 'Enables/Disables live reloading on changing files',

examples/cli/lazy/README.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

examples/cli/lazy/app.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/cli/lazy/webpack.config.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

lib/Server.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@ if (!process.env.WEBPACK_DEV_SERVER) {
5050

5151
class Server {
5252
constructor(compiler, options = {}, _log) {
53-
if (options.lazy && !options.filename) {
54-
throw new Error("'filename' option must be set in lazy mode.");
55-
}
56-
5753
validateOptions(schema, options, 'webpack Dev Server');
5854

5955
this.compiler = compiler;
@@ -763,10 +759,7 @@ class Server {
763759
}
764760

765761
showStatus() {
766-
const suffix =
767-
this.options.inline !== false || this.options.lazy === true
768-
? '/'
769-
: '/webpack-dev-server/';
762+
const suffix = this.options.inline !== false ? '/' : '/webpack-dev-server/';
770763
const uri = `${createDomain(this.options, this.listeningApp)}${suffix}`;
771764

772765
status(

lib/options.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,6 @@
9494
"type": "string"
9595
}
9696
},
97-
"filename": {
98-
"anyOf": [
99-
{
100-
"type": "string"
101-
},
102-
{
103-
"instanceof": "RegExp"
104-
},
105-
{
106-
"instanceof": "Function"
107-
}
108-
]
109-
},
11097
"fs": {
11198
"type": "object"
11299
},
@@ -192,9 +179,6 @@
192179
}
193180
]
194181
},
195-
"lazy": {
196-
"type": "boolean"
197-
},
198182
"liveReload": {
199183
"type": "boolean"
200184
},
@@ -445,7 +429,6 @@
445429
"contentBase": "should be {Number|String|Array} (https://webpack.js.org/configuration/dev-server/#devservercontentbase)",
446430
"disableHostCheck": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck)",
447431
"features": "should be {Array}",
448-
"filename": "should be {String|RegExp|Function} (https://webpack.js.org/configuration/dev-server/#devserverfilename-)",
449432
"fs": "should be {Object} (https://github.com/webpack/webpack-dev-middleware#fs)",
450433
"headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserverheaders-)",
451434
"historyApiFallback": "should be {Boolean|Object} (https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback)",
@@ -458,7 +441,6 @@
458441
"injectHot": "should be {Boolean|Function} (https://webpack.js.org/configuration/dev-server/#devserverinjecthot)",
459442
"inline": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverinline)",
460443
"key": "should be {String|Buffer}",
461-
"lazy": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverlazy-)",
462444
"liveReload": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverlivereload-)",
463445
"log": "should be {Function}",
464446
"logLevel": "should be {String} and equal to one of the allowed values\n\n [ 'info', 'warn', 'error', 'debug', 'trace', 'silent' ]\n\n (https://github.com/webpack/webpack-dev-middleware#loglevel)",

lib/utils/createConfig.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ function createConfig(config, argv, { port }) {
7272
}
7373
}
7474

75-
if (!options.filename && firstWpOpt.output && firstWpOpt.output.filename) {
76-
options.filename = firstWpOpt.output && firstWpOpt.output.filename;
77-
}
78-
7975
if (!options.watchOptions && firstWpOpt.watchOptions) {
8076
options.watchOptions = firstWpOpt.watchOptions;
8177
}
@@ -137,10 +133,6 @@ function createConfig(config, argv, { port }) {
137133
options.stats = Object.assign({}, options.stats, { colors: argv.color });
138134
}
139135

140-
if (argv.lazy) {
141-
options.lazy = true;
142-
}
143-
144136
// TODO remove in `v4`
145137
if (!argv.info) {
146138
options.noInfo = true;

test/Validation.test.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,6 @@ describe('Validation', () => {
7676
});
7777
});
7878

79-
describe('filename', () => {
80-
afterEach((done) => {
81-
server.close(() => {
82-
done();
83-
});
84-
});
85-
86-
it('should allow filename to be a function', () => {
87-
try {
88-
server = new Server(compiler, { filename: () => {} });
89-
} catch (err) {
90-
if (err === 'ValidationError') {
91-
throw err;
92-
}
93-
94-
throw new Error("Validation failed and it shouldn't");
95-
}
96-
});
97-
});
98-
9979
describe('checkHost', () => {
10080
afterEach((done) => {
10181
server.close(() => {

test/__snapshots__/Validation.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ exports[`Validation validation should fail validation for invalid \`writeToDisk\
3737
exports[`Validation validation should fail validation for no additional properties 1`] = `
3838
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
3939
- configuration has an unknown property 'additional'. These properties are valid:
40-
object { after?, allowedHosts?, before?, bonjour?, ca?, cert?, clientLogLevel?, compress?, contentBasePublicPath?, contentBase?, disableHostCheck?, features?, filename?, fs?, headers?, historyApiFallback?, host?, hot?, http2?, https?, index?, injectClient?, injectHot?, inline?, key?, lazy?, liveReload?, log?, logLevel?, logTime?, mimeTypes?, noInfo?, onListening?, open?, openPage?, overlay?, pfx?, pfxPassphrase?, port?, profile?, progress?, proxy?, public?, publicPath?, quiet?, reporter?, requestCert?, serveIndex?, serverSideRender?, setup?, sockHost?, sockPath?, sockPort?, socket?, staticOptions?, stats?, transportMode?, useLocalIp?, warn?, watchContentBase?, watchOptions?, writeToDisk? }"
40+
object { after?, allowedHosts?, before?, bonjour?, ca?, cert?, clientLogLevel?, compress?, contentBasePublicPath?, contentBase?, disableHostCheck?, features?, fs?, headers?, historyApiFallback?, host?, hot?, http2?, https?, index?, injectClient?, injectHot?, inline?, key?, liveReload?, log?, logLevel?, logTime?, mimeTypes?, noInfo?, onListening?, open?, openPage?, overlay?, pfx?, pfxPassphrase?, port?, profile?, progress?, proxy?, public?, publicPath?, quiet?, reporter?, requestCert?, serveIndex?, serverSideRender?, setup?, sockHost?, sockPath?, sockPort?, socket?, staticOptions?, stats?, transportMode?, useLocalIp?, warn?, watchContentBase?, watchOptions?, writeToDisk? }"
4141
`;

test/fixtures/schema/webpack.config.no-dev-stats.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ module.exports = {
1111
socket: '_socket',
1212
progress: '_progress',
1313
publicPath: '_publicPath',
14-
filename: '_filename',
1514
hot: '_hot',
1615
clientLogLevel: '_clientLogLevel',
1716
contentBase: '_contentBase',
1817
watchContentBase: '_watchContentBase',
19-
lazy: '_lazy',
2018
noInfo: '_noInfo',
2119
quiet: '_quiet',
2220
https: '_https',

test/options.test.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,6 @@ describe('options', () => {
163163
success: [['before'], []],
164164
failure: [false],
165165
},
166-
filename: {
167-
success: ['', new RegExp(''), () => {}],
168-
failure: [false],
169-
},
170166
fs: {
171167
success: [
172168
{
@@ -219,20 +215,6 @@ describe('options', () => {
219215
success: ['', Buffer.from('')],
220216
failure: [false],
221217
},
222-
lazy: {
223-
success: [
224-
{
225-
lazy: true,
226-
filename: '.',
227-
},
228-
],
229-
failure: [
230-
{
231-
lazy: '',
232-
filename: '.',
233-
},
234-
],
235-
},
236218
log: {
237219
success: [() => {}],
238220
failure: [''],

test/ports-map.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const portsList = {
2424
'http2-option': 1,
2525
'https-option': 1,
2626
'inline-option': 1,
27-
'lazy-option': 1,
2827
'liveReload-option': 1,
2928
'mineTypes-option': 1,
3029
'onListening-option': 1,

test/server/lazy-option.test.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/server/open-option.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('open option', () => {
2727
server.close(() => {
2828
expect(open.mock.calls[0]).toMatchInlineSnapshot(`
2929
Array [
30-
"http://localhost:8119/",
30+
"http://localhost:8118/",
3131
Object {
3232
"wait": false,
3333
},

test/server/servers/__snapshots__/WebsocketServer.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3-
exports[`WebsocketServer should receive connection, send message, and close client 1`] = `"localhost:8130"`;
3+
exports[`WebsocketServer should receive connection, send message, and close client 1`] = `"localhost:8129"`;
44

55
exports[`WebsocketServer should receive connection, send message, and close client 2`] = `
66
Array [

0 commit comments

Comments
 (0)