2
2
3
3
'use strict' ;
4
4
5
- /* eslint global-require: off, import/order: off, no-console: off */
5
+ /* eslint global-require: off, import/order: off, no-console: off, import/no-extraneous-dependencies: off */
6
6
require ( '../lib/polyfills' ) ;
7
7
8
8
const debug = require ( 'debug' ) ( 'webpack-dev-server' ) ;
@@ -24,6 +24,9 @@ if (importLocal(__filename)) {
24
24
const Server = require ( '../lib/Server' ) ;
25
25
const webpack = require ( 'webpack' ) ; // eslint-disable-line
26
26
27
+ // webpack has a nice message when webpack-cli is not installed, by requiring it we can also show that
28
+ require ( 'webpack/bin/webpack' ) ;
29
+
27
30
function versionInfo ( ) {
28
31
return `webpack-dev-server ${ require ( '../package.json' ) . version } \n` +
29
32
`webpack ${ require ( 'webpack/package.json' ) . version } ` ;
@@ -51,7 +54,7 @@ const defaultTo = (value, def) => value == null ? def : value;
51
54
const yargs = require ( 'yargs' )
52
55
. usage ( `${ versionInfo ( ) } \nUsage: https://webpack.js.org/configuration/dev-server/` ) ;
53
56
54
- require ( 'webpack/bin/config-yargs' ) ( yargs ) ;
57
+ require ( 'webpack-cli /bin/config-yargs' ) ( yargs ) ;
55
58
56
59
// It is important that this is done after the webpack yargs config,
57
60
// so it overrides webpack's version info.
@@ -220,7 +223,7 @@ yargs.options({
220
223
} ) ;
221
224
222
225
const argv = yargs . argv ;
223
- const wpOpt = require ( 'webpack/bin/convert-argv' ) ( yargs , argv , {
226
+ const wpOpt = require ( 'webpack-cli /bin/convert-argv' ) ( yargs , argv , {
224
227
outputFilename : '/bundle.js'
225
228
} ) ;
226
229
0 commit comments