aboutsummaryrefslogtreecommitdiff
path: root/Gruntfile.js
diff options
context:
space:
mode:
authorVictor Häggqvist <[email protected]>2014-06-09 16:15:23 +0200
committerVictor Häggqvist <[email protected]>2014-06-09 16:15:23 +0200
commit411adde03dce1da3d60eb6634fe0cf761f0dff93 (patch)
tree7908383aa9a1c82d416e359d8f95eb649f6ce7e6 /Gruntfile.js
parent05c23edfc0105ad539f1c3efdf18880d2ecb8b76 (diff)
stuff
Diffstat (limited to 'Gruntfile.js')
-rw-r--r--Gruntfile.js116
1 files changed, 116 insertions, 0 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..8d74cc1
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,116 @@
+/*global module:false*/
+module.exports = function(grunt) {
+
+ // Project configuration.
+ grunt.initConfig({
+ // Metadata.
+ pkg: grunt.file.readJSON('package.json'),
+ banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
+ '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
+ '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;' +
+ ' Licensed <%= pkg.license %>\n' +
+ '* Contributors <%= pkg.contributors.join(", ") %> */\n',
+ // Task configuration.
+ concat: {
+ options: {
+ banner: '<%= banner %>',
+ stripBanners: true
+ },
+ dist: {
+ src: ['js/<%= pkg.name %>.js'],
+ dest: 'dist/<%= pkg.name %>.js'
+ }
+ },
+ uglify: {
+ options: {
+ banner: '<%= banner %>'
+ },
+ dist: {
+ src: '<%= concat.dist.dest %>',
+ dest: 'dist/<%= pkg.name %>.min.js'
+ }
+ },
+ jshint: {
+ options: {
+ curly: true,
+ eqeqeq: true,
+ immed: true,
+ latedef: true,
+ newcap: true,
+ noarg: true,
+ sub: true,
+ undef: true,
+ unused: true,
+ boss: true,
+ eqnull: true,
+ globals: {}
+ },
+ gruntfile: {
+ src: 'Gruntfile.js'
+ },
+ main: {
+ src: 'js/*.js'
+ }
+ },
+ watch: {
+ gruntfile: {
+ files: '<%= jshint.gruntfile.src %>',
+ tasks: ['jshint:gruntfile']
+ },
+ main: {
+ options: {
+ reload: true
+ },
+ files: ['<%= jshint.main.src %>', 'sass/*.scss'],
+ // tasks: ['jshint:main', 'sass:dist_exp']
+ tasks: ['sass', 'copy']
+ }
+ },
+ sass: {
+ dist: {
+ options: {
+ style: 'compressed',
+ compass: true
+ },
+ files: {
+ 'dist/<%= pkg.name %>.min.css': 'sass/*.scss'
+ }
+ },
+ dist_exp: {
+ options: {
+ style: 'expanded',
+ sourcemap: true,
+ compass: true
+ },
+ files: {
+ 'dist/<%= pkg.name %>.css': 'sass/*.scss'
+ }
+ }
+ },
+ copy: {
+ demo: {
+ expand: true,
+ flatten: true,
+ src: 'dist/*.min.*',
+ dest: 'demo/',
+ filter: 'isFile'
+ }
+ }
+ });
+
+ // These plugins provide necessary tasks.
+ grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-sass');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-watch');
+
+ // Default task.
+ // grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'sass']);
+ grunt.registerTask('default', ['concat', 'uglify', 'sass']);
+
+ grunt.registerTask('demo', ['copy']);
+
+};