[Tendrl-devel] Make vs Gulp: can we just choose one?

Kanagaraj M kanagaraj.ktr at gmail.com
Mon Nov 7 09:57:10 UTC 2016


On Fri, Nov 4, 2016 at 6:07 PM, Soumya Deb <deb at redhat.com> wrote:

> On 2 November 2016 at 22:59, Kanagaraj M <kanagaraj.ktr at gmail.com> wrote:
>
> > Though both make and gulp are build systems, they serve different
> purpose.
> >
>
> Please do elaborate. I personally don't see them thrive to achieve
> different goals
> albeit using different mechanism.
>

Gulp is designed to more suitable for a frontend project where the source
would go through multiple transformations to reach the dist.


>
>
>
> > Since the project already has a dependency on node ecosystem, so gulp
> > relying on node is not something we need to worry about.
> >
>
> "already has node dependency" and gulp is about 75% reason behind that.
> If we can remove gulp, we are pretty close to not having Node.js deps.
> I am trying to understand which (if at all) sacrifices are needed for that.


I don't understand how we can just remove the nodejs dependency.  That
means, we don't use package.json, npm, etc.


>
>
> > In the existing code, gulp helps in 1).compiling TS to JS 2) create
> > sourcemaps 3) Combine JS files 4) Minify them 5) Copy to relevant path 6)
> > Inject the script tags in html, and lot more.
> >
>
> Make can do as well (in fact, I'm trying to find if make can't do
> something").
>

I did't say, make can't do this. I said, it would be more natural with Gulp.


>
>
>
> > The above can be achieved using Makefile, but i don't think its going to
> be
> > as straight forward as using gulp(or any nodejs based build system).
> >
>
> Example, gulp:
> ===========
> gulp.task('sass', function () {
>     return gulp.src(path.styles)
>         .pipe($.sourcemaps.init())
>         .pipe(sass())
>         .pipe($.concat('tendrl.css'))
>         .pipe($.sourcemaps.write('.'))
>         .pipe(gulp.dest(path.dist + '/css'));
>
> Same thing, make:
> =============
> sass: ${SASS}
>     cat $^ | sass --sourcemap compressed > ${DIST}/css/tendrl.css
>
> To me, second one is much more straight forward and more versatile.
> It's leaner and faster as well, as it's executing the commands directly
> instead of being wrapped within node-modules that does the proxying.
>

This is very basic example. Considering the following would be more
appropriate,

browserify({ entries: './app/app.js', debug: true })
        .bundle()
        .pipe(source('app.js'))
        .pipe(buffer())
        .pipe(ngAnnotate())
        .pipe(gulpif(argv.prod, uglify()))
        .pipe(gulp.dest(path.dist + '/scripts'));



>
>
>
> > IMO, using Makfile for all kind of build tasks are not the way to go.
> > Instead you can move from gulp+browserify to webpack and npm scripts if
> you
> > think gulp is verbose and complex. Then use the Makefile for packaging
> and
> > release.
>
>
> Gulp isn't complex, and switching between gulp/grunt/npm-script is
> the complete anti-theory of my proposal, unless we're using only
> one solution. And make is years proven and well supported tool
> to achieve the same thing - do we need these alternatives?
>
> In simpler words, what do we miss out if we move to `make` only?
>

There is no question about the capability of 'make', its about using a more
approriate tool.


> _______________________________________________
> Tendrl-devel mailing list
> Tendrl-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/tendrl-devel
>



More information about the Tendrl-devel mailing list