File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,15 @@ 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' ) ;
27
+ try {
28
+ require . resolve ( 'webpack-cli' ) ;
29
+ } catch ( e ) {
30
+ console . error ( 'The CLI moved into a separate package: webpack-cli.' ) ;
31
+ console . error ( "Please install 'webpack-cli' in addition to webpack itself to use the CLI." ) ;
32
+ console . error ( '-> When using npm: npm install webpack-cli -D' ) ;
33
+ console . error ( '-> When using yarn: yarn add webpack-cli -D' ) ;
34
+ process . exitCode = 1 ;
35
+ }
29
36
30
37
function versionInfo ( ) {
31
38
return `webpack-dev-server ${ require ( '../package.json' ) . version } \n` +
You can’t perform that action at this time.
0 commit comments