-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.js
53 lines (44 loc) · 1.03 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
function getPluginBanner () {
var pluginBanner = '';
pluginBanner += '/**\n';
pluginBanner += ' * Plugin: Model\n';
pluginBanner += ' * Author: Sundarasan Natarajan\n';
pluginBanner += ' * GIT: https://github.com/Sujsun/Model.git\n';
pluginBanner += ' * Version: 0.0.1\n';
pluginBanner += ' * Date: ' + new Date().toUTCString() + '\n';
pluginBanner += ' */\n';
return pluginBanner;
}
var pluginBanner = getPluginBanner();
module.exports = function(grunt) {
grunt.initConfig({
watchify: {
options: {
debug: true
},
dist: {
src: ['./index.js'],
dest: 'dist/model.js'
},
},
uglify: {
dist: {
options: {
banner: pluginBanner
},
files: {
'dist/model.min.js': ['dist/model.js']
}
}
},
});
grunt.loadNpmTasks('grunt-watchify');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('build', [
'watchify',
'uglify',
]);
grunt.registerTask('default', [
'build',
]);
};