-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGruntfile.js
More file actions
77 lines (67 loc) · 1.64 KB
/
Copy pathGruntfile.js
File metadata and controls
77 lines (67 loc) · 1.64 KB
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
'use strict';
module.exports = function( grunt ) {
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
project: {
src : {
js : [ 'src' ],
},
dist : {
js : [ 'dist' ],
}
},
uglify: {
options: {
banner: '/*! \n * <%= pkg.name %>.js v<%= pkg.version %> \n * <%= pkg.repo %>\n * © 2018-<%= grunt.template.today("yyyy") %> Derek Cavaliero @ LEVEL\n * Updated: <%= grunt.template.today("yyyy-mm-dd HH:MM:ss Z") %> \n */\n',
},
dist: {
options: {
beautify: false, // minify file when set to false
compress: true, // renames variables and all that
mangle: true,
compress: {
drop_console: false
}
},
files: {
'<%= project.dist.js %>/attributor.min.js': [
'<%= project.src.js %>/attributor.js'
]
}
},
dev: {
options: {
beautify: true, // minify file when set to false
compress: false, // renames variables and all that
mangle: false,
compress: {
drop_console: false
}
},
files: {
'<%= project.dist.js %>/attributor.js': [
'<%= project.src.js %>/attributor.js'
]
}
}
},
watch: {
grunt: {
files : [ 'Gruntfile.js' ],
tasks : [ 'build' ]
},
options: {
livereload : false
},
scripts: {
files : [ '<%= project.src.js %>/**/*.js' ],
tasks : [ 'uglify' ],
exclude : [ '!**/node_modules/**', '!**/bower_components/**' ]
}
},
});
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.registerTask( 'build', [ 'uglify' ] );
grunt.registerTask( 'default', [ 'build', 'watch' ] );
}