Search results for 2014 08 04 choose grunt gulp npm

Building a JavaScript Library with Grunt.js

by Brian Rinaldi

…{ options: { trailing: true, eqeqeq: true }, target: { src: [‘src/**/*.js’, ‘test/**/*.js’] } } }); grunt.loadNpmTasks(‘grunt-contrib-jshint’); grunt.loadNpmTasks(‘grunt-contrib-concat’); grunt.loadNpmTasks(‘grunt-contrib-uglify’); grunt.loadNpmTasks(‘grunt-contrib-copy’); grunt.loadNpmTasks(‘grunt-contrib-qunit’); grunt.registerTask(‘default’, [‘jshint’, ‘concat’, ‘uglify’, ‘copy’, ‘qunit’]); }; Conclusion Grunt.js…

A JavaScript Build System Shootout: Grunt vs. Gulp vs. NPM

by Nicolas Bevacqua

the gulp package from npm both locally and globally. touch Gulpfile.js npm install -g gulp npm install –save-dev gulp To get started, I’ll create a Gulp task to lint a…

Roll Your Own Asset Pipeline with Gulp

by Brian Rinaldi

npm install –save-dev gulp npm install –save-dev gulp-less Alright, now create your gulpfile.js: var gulp = require(‘gulp‘); var less = require(‘gulp-less’); gulp.task(‘less’, function() { return gulp.src(‘css/app.less’) .pipe(less()) .pipe(gulp.dest(‘dist’)); }); This…

Real-World Best Practices for Building Angular.js Apps without Browserify or Require.js

by Jeff Dickey

npm install -D gulp-ng-annotate And here’s the new gulpfile: var gulp = require(‘gulp‘) var concat = require(‘gulp-concat’) var uglify = require(‘gulp-uglify’) var ngAnnotate = require(‘gulp-ng-annotate’) gulp.task(‘js’, function () { gulp.src([‘src/**/module.js’,…

Automating Complex Workflows with Grunt Custom Tasks

by Ben Farrell

at how to run an existing Grunt task we’ve grabbed from npm or GitHub. In a Grunt.js file, we will typically Load the task. For example: grunt.loadNpmTasks(‘grunt-contrib-copy’); Register the task:…

Building Your First Grunt Plugin

by Brian Rinaldi

…should be cloned manually: git clone https://github.com/gruntjs/grunt-init-gruntplugin.git ~/.grunt-init/gruntplugin Next, execute grunt-init in the folder where you would like to create your plugin: grunt-init gruntplugin The scaffolder will ask you plenty…

Introduction to npm

by Brian Rinaldi

haven’t covered. Here are some good resources on npm: Tour of npm npm Tricks How to Build a Node npm Package From Scratch This article was originally published at http://smalljs.org/package-managers/npm/…

Automating CSS using Grunt

by Brian Rinaldi

…passed to CSSCSS. ‘use strict’; module.exports = function(grunt) { grunt.initConfig({ csscss: { options: { verbose: true }, dist: { src: [‘style.css’] } } }); grunt.loadNpmTasks(‘grunt-csscss’); grunt.registerTask(‘default’, [‘csscss’]); }; To run…

Writing a Command Line Utility using Node

by Brian Rinaldi

…(current version is 0.10.13) NPM installed (this is typically packaged with Node) Grunt-cli installed (if not run npm install -g grunt-cli) Grunt-Init installed (if not run npm install -g grunt-init)…

Modern Web Best Practice: Build Tools

by Aaron Bushnell

…var gulp = require(‘gulp‘), coffee = require(‘gulp-coffee’), concat = require(‘gulp-concat’), uglify = require(‘gulp-uglify’); gulp.task(‘scripts’, function() { return gulp.src(‘js/*.coffee’) .pipe(coffee()) .pipe(uglify()) .pipe(concat(‘all.min.js’)) .pipe(gulp.dest(‘build/js’)); }); You can see from the example that…