skia2/experimental/webtry/poly/Gruntfile.js
commit-bot@chromium.org 015c08e5ca Move zooming into its own component, imported via HTML Imports.
Also, start building our own polyfill library (polyfill.js) using Grunt and Bower.

Finally, refactor all the web pages so that the common header and footer material comes from templates.

BUG=skia:
R=mtklein@google.com

Author: jcgregorio@google.com

Review URL: https://codereview.chromium.org/292433002

git-svn-id: http://skia.googlecode.com/svn/trunk@14783 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-19 16:40:08 +00:00

65 lines
2.1 KiB
JavaScript

module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Install all the packages listed in the bower.json file.
shell: {
bower_install: {
command: 'bower install'
}
},
// Copy all the bower files into a single directory.
bower: {
dev: {
dest: '../../../out/grunt/third_party'
}
},
// Concatenate all the files in third_party into a single file.
concat: {
dist: {
src: [
'../../../out/grunt/third_party/WeakMap.js',
'../../../out/grunt/third_party/classlist.js',
'../../../out/grunt/third_party/pointerevents-polyfill.js',
'../../../out/grunt/third_party/MutationObserver.js',
'../../../out/grunt/third_party/CustomElements.js',
'../../../out/grunt/third_party/HTMLImports.js',
],
dest: '../../../out/grunt/src/<%= pkg.name %>.js'
}
},
// Uglify the one big file into one smaller file.
uglify: {
options: {
banner: '/*! <%= pkg.name %> built from /exerimental/webtry/poly <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: '../../../out/grunt/src/<%= pkg.name %>.js',
dest: '../res/js/<%= pkg.name %>.js'
}
},
copy: {
simple: {
src: '../../../out/grunt/src/<%= pkg.name %>.js',
dest: '../res/js/<%= pkg.name %>.js'
}
}
});
// Load the plugins for the above commands.
grunt.loadNpmTasks('grunt-bower');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-shell');
// By default run all the commands in the right sequence to build our custom minified polyfill.
grunt.registerTask('default', ['shell:bower_install', 'bower', 'concat', 'uglify']);
// A target to build an unminified version, for debugging.
grunt.registerTask('notmin', ['shell:bower_install', 'bower', 'concat', 'copy:simple']);
};