diff --git a/mod.ts b/mod.ts index 831985a..adf1fa5 100644 --- a/mod.ts +++ b/mod.ts @@ -85,6 +85,10 @@ export interface BuildOptions { * @default false */ skipSourceOutput?: boolean; + /** Skip running `npm install` + * @default false + */ + skipNpmInstall?: boolean; /** Root directory to find test files in. Defaults to the cwd. */ rootTestDir?: string; /** Glob pattern to use to find tests files. Defaults to `deno test`'s pattern. */ @@ -229,12 +233,14 @@ export async function build(options: BuildOptions): Promise { createNpmIgnore(); // install dependencies in order to prepare for checking TS diagnostics - log(`Running ${packageManager} install...`); - const npmInstallPromise = runNpmCommand({ - bin: packageManager, - args: ["install"], - cwd: options.outDir, - }); + if (!options.skipNpmInstall) log(`Running ${packageManager} install...`); + const npmInstallPromise = options.skipNpmInstall + ? Promise.resolve() + : runNpmCommand({ + bin: packageManager, + args: ["install"], + cwd: options.outDir, + }); if (options.typeCheck || options.declaration) { // Unfortunately this can't be run in parallel to building the project // in this case because TypeScript will resolve the npm packages when