News for hackers. Stuff that matters.
Re:Ask HN: What are the essential components of your front-e... by tzaman on Sunday July 27, 2014 @02:47PM (#8093586)
I have a question here, has anyone tried to create a task runner in plain shell (as bash script maybe). I imagine it could perform similar/same tasks as GruntJS, with maybe a bit more speed. At the cost of being slightly more complicated and I'd need to update/install dependencies manually. Just a thought.
Re:Ask HN: What are the essential components of your front-e... by mattdesl on Sunday July 27, 2014 @02:51PM (#8093599)
Sounds like Make.

You can also use npm-scripts for basic shell commands. You can rely on NPM-authored tasks and have them listed as a devDependency, so that users don't need to install anything manually.

  //create a UMD build for the browser
  "scripts": {
    "bundle": "browserify index.js -s foo > build/foo.js",
    "minify": "uglifyjs build/foo.js > build/foo.min.js",
    "build": "npm run bundle && npm run minify"     
  }
Now a user just needs to run this to build your app:

    npm run build
Re:Ask HN: What are the essential components of your front-e... by joshuacc on Sunday July 27, 2014 @03:50PM (#8093773)
This will certainly work in an exclusively *nix environment. However, if you need your build system to be Windows-compatible, you'll need to go with something like Grunt.
Re:Ask HN: What are the essential components of your front-e... by aeflash on Sunday July 27, 2014 @05:06PM (#8093969)
My team decided to just forget about Windows, and only use Linux or OSX. It is so much more convenient when you can rely on Bash, Make, and Unix conventions. (It is interesting discovering the slight incompatibilities between GNU core utils and OSX core utils, though, but usually the GNU versions just have extra features.)

Make plays nicely with npm once you set the PATH to include ./node_modules/.bin . Watching is the only thing Make can't do, so I usually set up a very simple Gruntfile that watches the source files, launches a livereload server, and just calls `make` when anything changes.

Re:Ask HN: What are the essential components of your front-e... by mattdesl on Wednesday August 06, 2014 @07:18PM (#8145424)
Npm run should work fine on windows.

Make is another story.

Re:Ask HN: What are the essential components of your front-e... by ricardobeat on Sunday July 27, 2014 @03:47PM (#8093762)
Manuel: http://manuel.00null.net

The main issue I have faced when trying to use bash scripts for this is that most frontend developers are not familiar with it, and a (thankfully) minority still uses Windows. You can still install dependencies from package.json and use ./node_modules/bin/xxx to execute them, so that's not a stopper.

I wrote a simple task-runner around the same time Grunt was born: http://ricardo.cc/cake-flour/, I still use it daily thought it's a bit out of date. Or you can use Gulp, still simpler and faster despite the quirky api.