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

Add a concat step to build to provide an unminified version for development #84

Merged
merged 1 commit into from
Jun 25, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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