-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathgruntfile.js
executable file
·123 lines (109 loc) · 2.28 KB
/
gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module.exports = function( grunt ) {
require( 'matchdep' ).filterDev( 'grunt-*' ).forEach( grunt.loadNpmTasks );
// destination path for deployment
// overwrite in hidden .deployment file
dest = 'path/for/deployment';
try {
require( './.deployment' );
} catch( error ) {}
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
less: {
development: {
files: {
'dist/css/108.css': 'src/less/108.less'
}
}
},
autoprefixer: {
style: {
src: 'dist/css/108.css',
dest: 'dist/css/108.css'
}
},
modernizr: {
dist: {
'dest' : 'src/js/dependencies/00-modernizr.js',
'options' : [
'setClasses',
'addTest',
'html5printshiv',
'testProp',
'fnBind',
'mq'
],
'tests' : [
'touchevents',
'pointerevents'
],
'files' : {
'src': [
'src/js/**/*.js',
'src/less/**/*.less',
'!node_modules/**/*',
'!src/js/**/*.min.js'
]
}
}
},
uglify: {
options: {
mangle: false
},
dependencies: {
files: {
'dist/js/dependencies.min.js': ['src/js/dependencies/*.js']
}
},
main: {
files: {
'dist/js/main.min.js': [
'src/js/debug.js',
'src/js/viewport.js',
'src/js/sequencer.js',
'src/js/timeline.js',
'src/js/ui.js',
'src/js/url.js',
'src/js/intro.js',
'src/js/title.js',
'src/js/history.js',
'src/js/recorder.js'
]
}
}
},
copy: {
deployment: {
files: [
{
expand: true,
src: ['src/**/*', 'dist/**/*', 'index.html', '!.*'],
dest: dest + '/'
},
],
},
},
watch: {
css: {
files: ['**/*.less'],
tasks: ['buildcss'],
options: {
livereload: true
}
},
js: {
files: ['src/js/**/*.js','!js/**/*.min.js'],
tasks: ['buildjs'],
options: {
livereload: true
}
}
}
} );
grunt.registerTask( 'default', ['build'] );
grunt.registerTask( 'buildcss', ['less', 'autoprefixer'] );
grunt.registerTask( 'buildmodernizr', ['modernizr'] );
grunt.registerTask( 'buildjs', ['uglify'] );
grunt.registerTask( 'deploy', ['copy'] );
grunt.registerTask( 'build', ['buildcss', 'buildmodernizr', 'buildjs'] );
};