dts-bundle icon indicating copy to clipboard operation
dts-bundle copied to clipboard

removeSource option deletes .d.ts files within node modules

Open cleavera opened this issue 7 years ago • 3 comments

When using the removeSource option. If your bundle references a .d.ts file inside node_modules it deletes this file.

I would expect it to ignore anything outside the project when cleaning up the definitions files

cleavera avatar Jul 17 '17 09:07 cleavera

It should be fixed at https://github.com/TypeStrong/dts-bundle/blob/master/lib/index.ts#L379

Could you build a regexpr to decide if you have to revome the file?

You could add other regexpr to the conditional, for example:

if (p !== outFile && dtsExp.test(p) && fs.statSync(p).isFile() && canRemoveExp.test())

tolemac avatar Jul 17 '17 09:07 tolemac

Just to confirm are you talking about a user configurable regular expression or a built in regex?

cleavera avatar Jul 17 '17 10:07 cleavera

I thought in a built in regexp at the moment... A regexp that exclude node_modules folder.

tolemac avatar Jul 17 '17 19:07 tolemac