Skip to content

Commit

Permalink
feat(node-resolve): Add default export (#361)
Browse files Browse the repository at this point in the history
BREAKING CHANGES:

- Corrects TypeScript interface name
- Adds default export
  • Loading branch information
NotWoods committed May 14, 2020
1 parent 5c9fc30 commit fe037db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions packages/node-resolve/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const defaults = {
};
export const DEFAULTS = deepFreeze(deepMerge({}, defaults));

export const nodeResolve = (opts = {}) => {
export function nodeResolve(opts = {}) {
const options = Object.assign({}, defaults, opts);
const { customResolveOptions, extensions, jail } = options;
const warnings = [];
Expand Down Expand Up @@ -258,4 +258,6 @@ export const nodeResolve = (opts = {}) => {
return idToPackageInfo.get(id);
}
};
};
}

export default nodeResolve;
5 changes: 3 additions & 2 deletions packages/node-resolve/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const DEFAULTS: {
resolveOnly: [];
};

export interface Options {
export interface RollupNodeResolveOptions {
/**
* If `true`, instructs the plugin to use the `"browser"` property in `package.json`
* files to specify alternative files to load for bundling. This is useful when
Expand Down Expand Up @@ -88,4 +88,5 @@ export interface Options {
/**
* Locate modules using the Node resolution algorithm, for using third party modules in node_modules
*/
export const nodeResolve: (options?: Options) => Plugin;
export function nodeResolve(options?: RollupNodeResolveOptions): Plugin;
export default nodeResolve;

0 comments on commit fe037db

Please sign in to comment.