diff --git a/types/browserify/browserify-tests.ts b/types/browserify/browserify-tests.ts index 2a1da315ed..c256d81ca3 100644 --- a/types/browserify/browserify-tests.ts +++ b/types/browserify/browserify-tests.ts @@ -60,3 +60,6 @@ Object.keys(insertGlobals.vars).forEach((x) => { var b = browserify('./browser/main.js', { insertGlobalVars: insertGlobalVars }); + +declare const file: string | string[]; +b.add(file); diff --git a/types/browserify/index.d.ts b/types/browserify/index.d.ts index e419fa2ceb..f9fb6aa3d8 100644 --- a/types/browserify/index.d.ts +++ b/types/browserify/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for Browserify 12.0 // Project: http://browserify.org/ -// Definitions by: Andrew Gaspar , John Vilk , Leonard Thieu +// Definitions by: Andrew Gaspar +// John Vilk +// Leonard Thieu +// Linus Unnebäck // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -102,8 +105,7 @@ interface BrowserifyObject extends NodeJS.EventEmitter { * Add an entry file from file that will be executed when the bundle loads. * If file is an array, each item in file will be added as an entry file. */ - add(file: InputFile[], opts?: FileOptions): BrowserifyObject; - add(file: InputFile, opts?: FileOptions): BrowserifyObject; + add(file: InputFile | InputFile[], opts?: FileOptions): BrowserifyObject; /** * Make file available from outside the bundle with require(file). * The file param is anything that can be resolved by require.resolve().