Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Merge pull request #84 from kborchers/concat-master
Browse files Browse the repository at this point in the history
Add a concat step to build to provide an unminified version for development
  • Loading branch information
dfreedm committed Jun 25, 2013
2 parents 3c1eb52 + 1a051bb commit 0db65d8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
43 changes: 28 additions & 15 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-karma');

var os = require('os').type();
var browsers = ['Chrome', 'Firefox'];
var sourceFiles = [
'src/boot.js',
'src/touch-action.js',
'src/PointerEvent.js',
'src/pointermap.js',
'src/sidetable.js',
'src/dispatcher.js',
'src/installer.js',
'src/mouse.js',
'src/touch.js',
'src/ms.js',
'src/platform-events.js',
'src/capture.js'
];

if (os == 'Darwin') {
browsers.push('ChromeCanary');
}
Expand All @@ -13,27 +29,24 @@ module.exports = function(grunt) {
}

grunt.initConfig({
concat: {
pointerevents: {
options: {
stripBanners: true,
banner: grunt.file.read('LICENSE')
},
src: sourceFiles,
dest: 'pointerevents.dev.js'
}
},
uglify: {
pointerevents: {
options: {
sourceMap: 'pointerevents.min.js.map',
banner: grunt.file.read('LICENSE')
},
dest: 'pointerevents.min.js',
src: [
'src/boot.js',
'src/touch-action.js',
'src/PointerEvent.js',
'src/pointermap.js',
'src/sidetable.js',
'src/dispatcher.js',
'src/installer.js',
'src/mouse.js',
'src/touch.js',
'src/ms.js',
'src/platform-events.js',
'src/capture.js',
]
src: sourceFiles
}
},
karma: {
Expand All @@ -53,7 +66,7 @@ module.exports = function(grunt) {
}
});

grunt.registerTask('default', 'uglify');
grunt.registerTask('default', ['concat', 'uglify']);
grunt.registerTask('test', 'karma:polymer');
grunt.registerTask('test-buildbot', 'karma:buildbot');
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"chai": "*",
"chai-spies": "*",
"grunt": "*",
"grunt-contrib-concat": "*",
"grunt-contrib-uglify": "*",
"grunt-contrib-yuidoc": "*",
"karma-mocha": "*",
Expand Down

0 comments on commit 0db65d8

Please sign in to comment.