ToddThomson / tsproject

Typescript minifier and modular typescript bundle optimizer for gulp (Ts Vinyl Adapter).
Other
57 stars 12 forks source link

Src() API Should Not Emit Build Files to Disk Outside of the Gulp Processing Pipeline #117

Open ToddThomson opened 3 years ago

ToddThomson commented 3 years ago

Currently, TsProject emits all build files ( js, d.ts, map ) to disk ( depending on the project tsconfig.json file ).

For Gulp, the built files should only flow through the build pipeline. The types of files flowing through the gulp pipeline will depend on compilerOptions settings is the project tsconfig.json file ( noEmit, declaration, sourceMap ).

ToddThomson commented 3 years ago

@niemyjski I would like to get your opinion/thoughts on the following:

The purpose of the TsBundler ( used in gulp-ts-bundler and TsProject ) component is to produce bundles. In order to do this it must use a Typescript compiler component ( Ts2Js ) to analyze the project dependencies ( the tsconfig.json file defines the project ).

My question is this: should the TsBundler component emit anything other than the output bundle assets? The build artifacts ( js, d.ts, .map files ) either passed through the gulp pipeline ( TsProject and gulp-ts-bundler ) or saved directly to disk ( Ts2Js ) are not needed. What do you do with the build artifacts?

My feeling is that TsBundler should just be a bundler. The Ts2Js compiler can be used to build projects, etc. with the output written to memory or disk.

niemyjski commented 3 years ago

I think it would not output anything other than the bundle assets as it's a bundler. The build artifacts get moved to a dist folder which we publish with our releases. All other temp files are deleted / ignored. I agree with you completely.