-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathGruntFile.js
63 lines (60 loc) · 1.56 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
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta:{
version:'<%=pkg.version%>',
banner:'/*! soma-template - v<%= meta.version %> - Romuald Quantin - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* http://soundstep.github.com/soma-template/\n' +
'* MIT licence <%= grunt.template.today("yyyy") %> ' +
'*/'
},
concat: {
dist: {
src: [
'src/1.prefix.js',
'src/2.settings.js',
'src/3.helpers.js',
'src/4.shared.js',
'src/5.scope.js',
'src/6.node.js',
'src/7.attribute.js',
'src/8.interpolation.js',
'src/9.expression.js',
'src/10.template.js',
'src/11.events.js',
'src/12.bootstrap.js',
'src/13.export.js',
'src/14.suffix.js'
],
dest: 'build/soma-template.js'
}
},
uglify: {
options: {
banner: '/*\n<%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\nhttp://soundstep.github.com/soma-template/\nhttp://www.soundstep.com\nMIT licence <%= grunt.template.today("yyyy")%>\n*/\n',
mangle:{
except:['instance', 'injector']
}
},
my_target: {
files: {
'build/soma-template-v<%= meta.version %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
watch:{
scripts:{
files:[
'src/*.js',
'grunt.js'
],
tasks: ['concat', 'uglify']
}
}
});
grunt.registerTask('default', ['concat', 'uglify']);
}