Skip to content

Commit

Permalink
feat: support dts build --noClean (fixes jaredpalmer#103) (jaredpal…
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add authored and bluelovers committed Dec 12, 2021
1 parent 0a7cf55 commit e059099
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ prog
.example('build --name Foo')
.option('--format', 'Specify module format(s)', 'cjs,esm')
.example('build --format cjs,esm')
.option('--noClean', "Don't clean the dist folder")
.example('build --noClean')
.option('--tsconfig', 'Specify custom tsconfig path')
.example('build --tsconfig ./tsconfig.foo.json')
.option('--transpileOnly', 'Skip type checking')
Expand All @@ -409,7 +411,9 @@ prog
.action(async (dirtyOpts: BuildOpts) => {
const opts = await normalizeOpts(dirtyOpts);
const buildConfigs = await createBuildConfigs(opts);
await cleanDistFolder();
if (!opts.noClean) {
await cleanDistFolder();
}
const logger = await createProgressEstimator();
if (opts.format.includes('cjs')) {
const promise = writeCjsEntryFile(opts.name).catch(logError);
Expand Down

0 comments on commit e059099

Please sign in to comment.