forked from needim/noty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
59 lines (54 loc) · 2.34 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
module.exports = function(grunt) {
grunt.initConfig({
bump : {
options: {
files : ['package.json', 'noty.jquery.json', 'js/noty/jquery.noty.js'],
updateConfigs : [],
commit : false,
commitMessage : 'Release v%VERSION%',
commitFiles : ['-a'],
createTag : false,
tagName : 'v%VERSION%',
tagMessage : 'Version %VERSION%',
push : false,
pushTo : 'upstream',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d'
}
},
concat: {
dist: {
src : ['js/noty/jquery.noty.js', 'js/noty/layouts/*.js', 'js/noty/themes/*.js'],
dest: 'js/noty/packaged/jquery.noty.packaged.js'
}
},
wrap: {
basic: {
src: 'js/noty/packaged/jquery.noty.packaged.js',
dest: 'js/noty/packaged/jquery.noty.packaged.js',
options: {
wrapper: ["!function(root, factory) {\n\t if (typeof define === 'function' && define.amd) {\n\t\t define(['jquery'], factory);\n\t } else if (typeof exports === 'object') {\n\t\t module.exports = factory(require('jquery'));\n\t } else {\n\t\t factory(root.jQuery);\n\t }\n}(this, function($) {\n", "\nreturn window.noty;\n\n});"]
}
}
},
uglify: {
//options : {
// preserveComments: function(a) {
// return !!(a.start.file == 'js/noty/jquery.noty.js' && a.start.line == 11);
// }
//},
minifyJS: {
files: {
'js/noty/packaged/jquery.noty.packaged.min.js': ['js/noty/packaged/jquery.noty.packaged.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-release-component');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-wrap');
grunt.registerTask('build', ['bump', 'concat', 'wrap', 'uglify:minifyJS']);
grunt.registerTask('conc', ['concat', 'wrap']);
grunt.registerTask('ugly', ['uglify:minifyJS']);
};