-
Notifications
You must be signed in to change notification settings - Fork 10
/
Gruntfile.js
57 lines (47 loc) · 1.26 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
module.exports = function(grunt) {
var globalConfig = {
today: grunt.template.today("yyyy-mm-dd"),
banner: '/*! <%= pkg.title %>, v<%= pkg.version %> (built <%= globalConfig.today %>) <%= pkg.homepage %> @preserve */\n'
};
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
globalConfig: globalConfig,
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.config('uglify', {
options: {
banner: globalConfig.banner
},
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['dist/<%= pkg.name %>.js']
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.config('concat', {
options: {
banner: globalConfig.banner + '(function(){\n\n',
separator: '\n\n////////////////////////////////////////\n\n',
footer: '\n\n})();',
},
dist: {
files: {
'dist/<%= pkg.name %>.js': [
'src/Canvallax.js',
'src/Utilities/**/*.js',
'src/Elements/**/*.js'
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.config('watch', {
scripts: {
files: 'src/**/*.js',
tasks: ['uglify'],
options: { debounceDelay: 250 },
}
});
grunt.registerTask('default', ['concat','uglify']);
};