Skip to content

Commit 2c18c29

Browse files
committed
[resolvers/webpack] [refactor] remove lodash/get usage
1 parent b9b9c86 commit 2c18c29

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

resolvers/webpack/index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const findRoot = require('find-root');
44
const path = require('path');
5-
const get = require('lodash/get');
65
const isEqual = require('lodash/isEqual');
76
const find = require('array.prototype.find');
87
const interpret = require('interpret');
@@ -51,15 +50,15 @@ exports.resolve = function (source, file, settings) {
5150

5251
let webpackConfig;
5352

54-
const _configPath = get(settings, 'config');
53+
const _configPath = settings && settings.config;
5554
/**
5655
* Attempt to set the current working directory.
5756
* If none is passed, default to the `cwd` where the config is located.
5857
*/
59-
const cwd = get(settings, 'cwd');
60-
const configIndex = get(settings, 'config-index');
61-
const env = get(settings, 'env');
62-
const argv = get(settings, 'argv', {});
58+
const cwd = settings && settings.cwd;
59+
const configIndex = settings && settings['config-index'];
60+
const env = settings && settings.env;
61+
const argv = settings && typeof settings.argv !== 'undefined' ? settings.argv : {};
6362
let packageDir;
6463

6564
let configPath = typeof _configPath === 'string' && _configPath.startsWith('.')

0 commit comments

Comments
 (0)