johnpapa / gulp-patterns

Playground for Gulp Recipes
501 stars 146 forks source link

doubts on the build process #125

Closed gerardolima closed 5 years ago

gerardolima commented 7 years ago

Hi, there,

I'm trying to migrate a Gulp process to include Typescript and I'm stumbling upon several issues I'd be more than happy to discuss with its team, but on its issues page, they just redirect discussions to stackoverflow; weel, I posted my question there, but I'm not having much feedback. Since this is an important source for many developers, I hope my questions about the build process of an Angular application will be heard:

  1. why use Bower? all bower packages yoman bloated into the initial build process exist in Npm; I don't like using more than one single tool for the same job;
  2. why use an automatic plugin loader? it's easy, too easy, to forget plugins used for tests on local environment; having them available to the Gulp process feels like magic (or voodoo, pick yours);
  3. why automatically binding the automatically loaded plugins on their names on "gulp.config.js"? one very nice feature of the Gulp streams is to allow composition in a very natural way, but using this pattern just make it not possible and turns Gulp almost into ... Grunt;
  4. why not use javascript-aware tool to make the bundle (like browserify, webpack, ...)? bundling all javascript files together requires for the developer to know all the subtle dependencies among libraries -- I already had a hard to spot problem when jQuery was loaded after Angular and the pseudo selector ":first" would yield nothing, without any compilation or run-time error;
  5. why use such plugins as "gulp-inject" or "usemin"? I see Angular applications as javascript that happen to have HTML views, instead of HTML pages that happen to have javascript behavior; that way, I just have exactly two 'script' tags, one for my code, one for vendor's and the same for css; I believe file transversing should follow the language specifications (JS/TS and CSS) and produce deterministic outputs that could be statically named on the application loader (index.html).
  6. why include image optimization into the application build process?

Please consider these questions as very sincere -- of course, it's possible to spot some preferences, due to many headaches I had before but, utterly -- I want to understand the whys, as there are many, many ways to solve the same problem.