“NPM Scripts vs. Gulp” Round 2, feat. gulp-shelter

The “NPM as a build tool” revolution

$ npm install
$ npm run build

The day I wrote my first build+deploy script in a package.json felt really good. I was experimenting with Browserify, Surge.sh and Travis, and I was able to quickly setup continuous-deployment for a small Single Page Application. I even managed to learn a bit of bash magic!
The day I had to revisit these NPM scripts didn’t feel quite as good, though :-(

Maintaining and growing NPM scripts

"browserify": "browserify src/project.js --standalone project --noparse node_modules/dep1/dist/dep1.js node_modules/dep2/dist/dep2.js --dg --debug | exorcist dist/project.js.map > dist/project.js",

Reusing NPM scripts and not repeating yourself

Learning Bash syntax

Introducing Gulp-Shelter!

"scripts": {
"gulp": "gulp",
"help": "gulp --tasks"
},
$ npm run help

> project.js@1.0.0 help /home/myself/workspace/project.js
> gulp --tasks
[22:56:47] Tasks for ~/workspace/project.js/gulpfile.js
[22:56:47] ├── build Generate project lib and source-map
[22:56:47] ├── deploy Run by Travis to deploy on Surge
[22:56:47] └── serve Open index.html and live-reload on changes
$ npm run gulp -- <task name>

Do you share our interest in using JS to create simple tools that help creative people out there? Drop us an email: jobs@prototypo.io

--

--

--

My parents were the Pierre & Marie Curie of SEO: you can google me with my first-name.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Louis-Rémi Babé

Louis-Rémi Babé

My parents were the Pierre & Marie Curie of SEO: you can google me with my first-name.

More from Medium

Implementing a Countdown Element in a Quick App

Why Next JS Cannot Be Ignored

Jotai

Testing a React Component Library package locally, using Yarn and Craco

React Component Libraries