Skip to content

Commit

Permalink
Wrap module
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey committed Apr 12, 2020
1 parent 814ed69 commit 284d037
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/node-resolve/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
const builtins = new Set(builtinList);
const ES6_BROWSER_EMPTY = '\0node-resolve:empty.js';
const nullFn = () => null;
export const defaults = {
export const DEFAULT_OPTIONS = {
customResolveOptions: {},
dedupe: [],
// It's important that .mjs is listed before .js so that Rollup will interpret npm modules
Expand All @@ -26,8 +26,8 @@ export const defaults = {
resolveOnly: []
};

export default function nodeResolve(opts = {}) {
const options = Object.assign({}, defaults, opts);
const mod = function nodeResolve(opts = {}) {
const options = Object.assign({}, DEFAULT_OPTIONS, opts);
const { customResolveOptions, extensions, jail } = options;
const warnings = [];
const packageInfoCache = new Map();
Expand Down Expand Up @@ -250,4 +250,6 @@ export default function nodeResolve(opts = {}) {
return idToPackageInfo.get(id);
}
};
}
};
mod.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
export default mod;

0 comments on commit 284d037

Please sign in to comment.