From 0fde53e0baddfc4d1a299683674b4bd949c1a44f Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Tue, 9 Apr 2019 21:55:19 +0200 Subject: [PATCH 1/3] fix(type): allow options to be exported --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 9c4d2fe..ece169f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,7 +1,7 @@ import {Plugin} from 'rollup'; import {AsyncOpts} from 'resolve'; -interface RollupNodeResolveOptions { +export interface RollupNodeResolveOptions { /** * the fields to scan in a package.json to determine the entry point * if this list contains "browser", overrides specified in "pkg.browser" From 73c1bcf1e0ede85e907ae2b7f56cddceb3a50586 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Tue, 9 Apr 2019 21:57:31 +0200 Subject: [PATCH 2/3] fix(type): rename options type name --- index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index ece169f..72650e5 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,7 +1,7 @@ import {Plugin} from 'rollup'; import {AsyncOpts} from 'resolve'; -export interface RollupNodeResolveOptions { +export interface Options { /** * the fields to scan in a package.json to determine the entry point * if this list contains "browser", overrides specified in "pkg.browser" @@ -86,4 +86,4 @@ export interface RollupNodeResolveOptions { /** * Locate modules using the Node resolution algorithm, for using third party modules in node_modules */ -export default function nodeResolve(options?: RollupNodeResolveOptions): Plugin; +export default function nodeResolve(options?: Options): Plugin; From eeddb7b2c98fa55640dc0ca7b479d2655f3f71e8 Mon Sep 17 00:00:00 2001 From: Hugo Alliaume Date: Tue, 9 Apr 2019 21:58:03 +0200 Subject: [PATCH 3/3] add some spaces --- index.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.d.ts b/index.d.ts index 72650e5..fef2b26 100644 --- a/index.d.ts +++ b/index.d.ts @@ -9,12 +9,14 @@ export interface Options { * @default ['module', 'main'] */ mainFields?: ['browser', 'esnext', 'module', 'main'], + /** * @deprecated use "mainFields" instead * use "module" field for ES6 module if possible * @default true */ module?: boolean; + /** * @deprecated use "mainFields" instead * use "jsnext:main" if possible @@ -24,6 +26,7 @@ export interface Options { * @default false */ jsnext?: boolean; + /** * @deprecated use "mainFields" instead * use "main" field or index.js, even if it's not an ES6 module @@ -32,6 +35,7 @@ export interface Options { * @default true */ main?: boolean; + /** * some package.json files have a "browser" field which specifies * alternative files to load for people bundling for the browser. If @@ -40,23 +44,27 @@ export interface Options { * @default false */ browser?: boolean; + /** * not all files you want to resolve are .js files * @default [ '.mjs', '.js', '.json', '.node' ] */ extensions?: ReadonlyArray; + /** * whether to prefer built-in modules (e.g. `fs`, `path`) or * local ones with the same names * @default true */ preferBuiltins?: boolean; + /** * Lock the module search in this path (like a chroot). Module defined * outside this path will be marked as external * @default '/' */ jail?: string; + /** * Set to an array of strings and/or regexps to lock the module search * to modules that match at least one entry. Modules not matching any @@ -64,18 +72,21 @@ export interface Options { * @default null */ only?: ReadonlyArray | null; + /** * If true, inspect resolved files to check that they are * ES2015 modules * @default false */ modulesOnly?: boolean; + /** * Force resolving for these modules to root's node_modules that helps * to prevent bundling the same package multiple times if package is * imported from dependencies. */ dedupe?: string[]; + /** * Any additional options that should be passed through * to node-resolve