-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: compatibility with [email protected] (#1754)
- Loading branch information
1 parent
732e6c5
commit fd7cb0d
Showing
3 changed files
with
2,506 additions
and
2,536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,8 +74,17 @@ yargs.usage( | |
`${getVersions()}\nUsage: https://webpack.js.org/configuration/dev-server/` | ||
); | ||
|
||
// [email protected] path : 'webpack-cli/bin/config/config-yargs' | ||
let configYargsPath; | ||
try { | ||
require.resolve('webpack-cli/bin/config/config-yargs'); | ||
configYargsPath = 'webpack-cli/bin/config/config-yargs'; | ||
} catch (e) { | ||
configYargsPath = 'webpack-cli/bin/config-yargs'; | ||
} | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
require('webpack-cli/bin/config-yargs')(yargs); | ||
// eslint-disable-next-line import/no-dynamic-require | ||
require(configYargsPath)(yargs); | ||
|
||
// It is important that this is done after the webpack yargs config, | ||
// so it overrides webpack's version info. | ||
|
@@ -84,8 +93,17 @@ yargs.options(options); | |
|
||
const argv = yargs.argv; | ||
|
||
// [email protected] path : 'webpack-cli/bin/utils/convert-argv' | ||
let convertArgvPath; | ||
try { | ||
require.resolve('webpack-cli/bin/utils/convert-argv'); | ||
convertArgvPath = 'webpack-cli/bin/utils/convert-argv'; | ||
} catch (e) { | ||
convertArgvPath = 'webpack-cli/bin/convert-argv'; | ||
} | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
const config = require('webpack-cli/bin/convert-argv')(yargs, argv, { | ||
// eslint-disable-next-line import/no-dynamic-require | ||
const config = require(convertArgvPath)(yargs, argv, { | ||
outputFilename: '/bundle.js', | ||
}); | ||
|
||
|
Oops, something went wrong.