Skip to content

Commit 51cc950

Browse files
committed
fix: remove lazy and filename options
1 parent 023c194 commit 51cc950

18 files changed

+4
-295
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;
@@ -758,10 +754,7 @@ class Server {
758754
}
759755

760756
showStatus() {
761-
const suffix =
762-
this.options.inline !== false || this.options.lazy === true
763-
? '/'
764-
: '/webpack-dev-server/';
757+
const suffix = this.options.inline !== false ? '/' : '/webpack-dev-server/';
765758
const uri = `${createDomain(this.options, this.listeningApp)}${suffix}`;
766759

767760
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
},
@@ -188,9 +175,6 @@
188175
}
189176
]
190177
},
191-
"lazy": {
192-
"type": "boolean"
193-
},
194178
"liveReload": {
195179
"type": "boolean"
196180
},
@@ -441,7 +425,6 @@
441425
"contentBase": "should be {Number|String|Array} (https://webpack.js.org/configuration/dev-server/#devservercontentbase)",
442426
"disableHostCheck": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck)",
443427
"features": "should be {Array}",
444-
"filename": "should be {String|RegExp|Function} (https://webpack.js.org/configuration/dev-server/#devserverfilename-)",
445428
"fs": "should be {Object} (https://github.com/webpack/webpack-dev-middleware#fs)",
446429
"headers": "should be {Object} (https://webpack.js.org/configuration/dev-server/#devserverheaders-)",
447430
"historyApiFallback": "should be {Boolean|Object} (https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback)",
@@ -455,7 +438,6 @@
455438
"injectHot": "should be {Boolean|Function} (https://webpack.js.org/configuration/dev-server/#devserverinjecthot)",
456439
"inline": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverinline)",
457440
"key": "should be {String|Buffer}",
458-
"lazy": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverlazy-)",
459441
"liveReload": "should be {Boolean} (https://webpack.js.org/configuration/dev-server/#devserverlivereload-)",
460442
"log": "should be {Function}",
461443
"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
}
@@ -143,10 +139,6 @@ function createConfig(config, argv, { port }) {
143139
options.stats = Object.assign({}, options.stats, { colors: argv.color });
144140
}
145141

146-
if (argv.lazy) {
147-
options.lazy = true;
148-
}
149-
150142
// TODO remove in `v4`
151143
if (!argv.info) {
152144
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
@@ -33,5 +33,5 @@ exports[`Validation validation should fail validation for invalid \`writeToDisk\
3333
exports[`Validation validation should fail validation for no additional properties 1`] = `
3434
"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
3535
- configuration has an unknown property 'additional'. These properties are valid:
36-
object { after?, allowedHosts?, before?, bonjour?, ca?, cert?, clientLogLevel?, compress?, contentBasePublicPath?, contentBase?, disableHostCheck?, features?, filename?, fs?, headers?, historyApiFallback?, host?, hot?, hotOnly?, 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? }"
36+
object { after?, allowedHosts?, before?, bonjour?, ca?, cert?, clientLogLevel?, compress?, contentBasePublicPath?, contentBase?, disableHostCheck?, features?, fs?, headers?, historyApiFallback?, host?, hot?, hotOnly?, 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? }"
3737
`;

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@ module.exports = {
1111
socket: '_socket',
1212
progress: '_progress',
1313
publicPath: '_publicPath',
14-
filename: '_filename',
1514
hot: '_hot',
1615
hotOnly: '_hotOnly',
1716
clientLogLevel: '_clientLogLevel',
1817
contentBase: '_contentBase',
1918
watchContentBase: '_watchContentBase',
20-
lazy: '_lazy',
2119
noInfo: '_noInfo',
2220
quiet: '_quiet',
2321
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
{
@@ -223,20 +219,6 @@ describe('options', () => {
223219
success: ['', Buffer.from('')],
224220
failure: [false],
225221
},
226-
lazy: {
227-
success: [
228-
{
229-
lazy: true,
230-
filename: '.',
231-
},
232-
],
233-
failure: [
234-
{
235-
lazy: '',
236-
filename: '.',
237-
},
238-
],
239-
},
240222
log: {
241223
success: [() => {}],
242224
failure: [''],

test/ports-map.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const portsList = {
2525
'http2-option': 1,
2626
'https-option': 1,
2727
'inline-option': 1,
28-
'lazy-option': 1,
2928
'liveReload-option': 1,
3029
'mineTypes-option': 1,
3130
'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:8120/",
30+
"http://localhost:8119/",
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:8131"`;
3+
exports[`WebsocketServer should receive connection, send message, and close client 1`] = `"localhost:8130"`;
44

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

0 commit comments

Comments
 (0)