Skip to content

Commit

Permalink
chore(coffee to js): converts Gruntfile.coffee to Gruntfile.js for be…
Browse files Browse the repository at this point in the history
…tter consistency and Bumps up a few old package versions to newer ones
  • Loading branch information
arjunkathuria committed Jun 27, 2016
1 parent dc85133 commit dc0999f
Show file tree
Hide file tree
Showing 3 changed files with 118 additions and 103 deletions.
95 changes: 0 additions & 95 deletions Gruntfile.coffee

This file was deleted.

110 changes: 110 additions & 0 deletions Gruntfile.js
@@ -0,0 +1,110 @@
var babel = require('rollup-plugin-babel');

module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
usebanner: {
taskName: {
options: {
position: 'top',
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n * <%= pkg.homepage %>\n *\n * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;\n * Licensed under the <%= pkg.license %> license */',
linebreak: true
},
files: {
src: ['./hammer.js', './hammer.min.js']
}
}
},
rollup: {
options: {
format: 'es6',
plugins: [
babel({
exclude: 'node_modules/**'
})
],
intro: " (function(window, document, exportName, undefined) { \n'use strict';",
outro: "})(window, document, 'Hammer');"
},
files: {
dest: 'hammer.js',
src: 'src/main.js'
}
},
uglify: {
min: {
options: {
report: 'gzip',
sourceMap: 'hammer.min.map'
},
files: {
'hammer.min.js': ['hammer.js']
}
}
},
'string-replace': {
version: {
files: {
'hammer.js': 'hammer.js'
},
options: {
replacements: [
{
pattern: '{{PKG_VERSION}}',
replacement: '<%= pkg.version %>'
}
]
}
}
},
jshint: {
options: {
jshintrc: true
},
build: {
src: ['hammer.js']
}
},
jscs: {
src: ['src/**/*.js'],
options: {
config: "./.jscsrc",
force: true
}
},
watch: {
scripts: {
files: ['src/**/*.js'],
tasks: ['rollup', 'string-replace', 'uglify', 'jshint', 'jscs'],
options: {
interrupt: true
}
}
},
connect: {
server: {
options: {
hostname: "0.0.0.0",
port: 8000
}
}
},
qunit: {
all: ['tests/unit/index.html']
}
});
grunt.loadNpmTasks('grunt-rollup');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-string-replace');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-jscs');
grunt.registerTask('default', ['connect', 'watch']);
grunt.registerTask('default-test', ['connect', 'uglify:test', 'watch']);
grunt.registerTask('build', ['rollup', 'string-replace', 'uglify:min', 'usebanner', 'test']);
grunt.registerTask('test', ['jshint', 'jscs', 'qunit']);
grunt.registerTask('test-travis', ['build']);
};
16 changes: 8 additions & 8 deletions package.json
Expand Up @@ -34,18 +34,18 @@
"devDependencies": {
"babel-preset-es2015-rollup": "^1.1.1",
"changelogplease": "^1.2.0",
"ember-suave": "3.0.1",
"ember-suave": "^3.0.1",
"git-tags": "^0.2.4",
"grunt": "0.4.x",
"grunt-banner": "^0.2.3",
"grunt-contrib-connect": "0.7.x",
"grunt": "1.0.x",
"grunt-banner": "^0.6.0",
"grunt-contrib-connect": "^1.0.0",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-qunit": "^0.5.1",
"grunt-contrib-qunit": "^1.2.0",
"grunt-contrib-uglify": "^1.0.0",
"grunt-contrib-watch": "0.6.x",
"grunt-jscs": "3.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-jscs": "^3.0.0",
"grunt-rollup": "^0.7.1",
"grunt-string-replace": "^0.2.7",
"grunt-string-replace": "^1.2.x",
"hammer-simulator": "git://github.com/hammerjs/simulator#master",
"jquery-hammerjs": "2.0.x",
"rollup": "^0.26.3",
Expand Down

0 comments on commit dc0999f

Please sign in to comment.