Skip to content

Commit

Permalink
[resolvers/webpack] Replace node-libs-browser with is-core-module
Browse files Browse the repository at this point in the history
This significantly shrinks our dependency tree.  Fixes #631.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed Dec 22, 2020
1 parent 18f9bd3 commit ff50964
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions resolvers/webpack/index.js
Expand Up @@ -5,7 +5,7 @@ var findRoot = require('find-root')
, find = require('array-find')
, interpret = require('interpret')
, fs = require('fs')
, coreLibs = require('node-libs-browser')
, isCore = require('is-core-module')
, resolve = require('resolve')
, semver = require('semver')
, has = require('has')
Expand Down Expand Up @@ -142,8 +142,8 @@ exports.resolve = function (source, file, settings) {
try {
return { found: true, path: resolveSync(path.dirname(file), source) }
} catch (err) {
if (source in coreLibs) {
return { found: true, path: coreLibs[source] }
if (isCore(source)) {
return { found: true, path: null }
}

log('Error during module resolution:', err)
Expand Down
2 changes: 1 addition & 1 deletion resolvers/webpack/package.json
Expand Up @@ -38,8 +38,8 @@
"find-root": "^1.1.0",
"has": "^1.0.3",
"interpret": "^1.2.0",
"is-core-module": "^2.0.0",
"lodash": "^4.17.15",
"node-libs-browser": "^1.0.0 || ^2.0.0",
"resolve": "^1.13.1",
"semver": "^5.7.1"
},
Expand Down

0 comments on commit ff50964

Please sign in to comment.