1
+ module . exports = function ( grunt ) {
2
+
3
+ 'use strict' ;
4
+
5
+ grunt . initConfig ( {
6
+ pkg : grunt . file . readJSON ( 'package.json' ) ,
7
+ meta : {
8
+ version : '<%= pkg.version %>' ,
9
+ banner : '// Jenga: fuck z-indexes\n' +
10
+ '// ----------------------------------\n' +
11
+ '// v<%= pkg.version %>\n' +
12
+ '//\n' +
13
+ '// Copyright (c)<%= grunt.template.today("yyyy") %> Jason Strimpel\n' +
14
+ '// Distributed under MIT license\n'
15
+ } ,
16
+ preprocess : {
17
+ global : {
18
+ files : {
19
+ 'dist/jenga.js' : 'src/jenga.global.js'
20
+ }
21
+ } ,
22
+ amd : {
23
+ files : {
24
+ 'dist/jenga.amd.js' : 'src/jenga.amd.js'
25
+ }
26
+ } ,
27
+ plugin : {
28
+ files : {
29
+ 'dist/jenga.plugin.js' : 'src/jenga.plugin.js'
30
+ }
31
+ }
32
+ } ,
33
+ concat : {
34
+ options : {
35
+ banner : "<%= meta.banner %>"
36
+ } ,
37
+ global : {
38
+ src : 'dist/jenga.js' ,
39
+ dest : 'dist/jenga.js'
40
+ } ,
41
+ amd : {
42
+ src : 'dist/jenga.amd.js' ,
43
+ dest : 'dist/jenga.amd.js'
44
+ } ,
45
+ plugin : {
46
+ src : 'dist/jenga.plugin.js' ,
47
+ dest : 'dist/jenga.plugin.js'
48
+ }
49
+ } ,
50
+ mocha_phantomjs : {
51
+ all : [ 'test/**/*.html' ]
52
+ }
53
+ } ) ;
54
+
55
+ grunt . loadNpmTasks ( 'grunt-preprocess' ) ;
56
+ grunt . loadNpmTasks ( 'grunt-contrib-concat' ) ;
57
+ grunt . loadNpmTasks ( 'grunt-mocha-phantomjs' ) ;
58
+
59
+ grunt . registerTask ( 'test' , [ 'mocha_phantomjs' ] ) ;
60
+ grunt . registerTask ( 'default' , [
61
+ 'preprocess:global' , 'concat:global' , 'preprocess:amd' , 'concat:amd' , 'preprocess:plugin' , 'concat:plugin'
62
+ ] ) ;
63
+ } ;
0 commit comments