-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
68 lines (64 loc) · 1.75 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
64
65
66
67
68
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%=pkg.name %> v<%=pkg.version %> <%=grunt.template.today("yyyy-mm-dd")%> <%=pkg.author.name%> <%=pkg.homepage%> */\n'
},
eoraptor: {
files: {
'build/eoraptor.min.js': ['build/eoraptor.js']
}
}
},
replace: {
eoraptor: {
src: ['src/eoraptor.js'],
dest: 'build/eoraptor.js',
replacements: [{
from: '#VERSION#',
to: '<%=pkg.version%>'
}, {
from: '#UPDATE#',
to: '<%=grunt.template.today("yyyy-mm-dd") %>'
}, {
from: '#DESCRIPTION#',
to: '<%=pkg.description%>'
}]
}
},
watch: {
js: {
files: [
'src/eoraptor.js',
'test/test.html',
'test/test.js',
'test/dev.html',
'test/dev.js'
],
// tasks: ['concat:js', 'uglify:js'],
options: {
livereload: true,
}
}
},
eoraptor_jst: {
cmd: {
options: {
namespace: 'tpl',
module: false,
ext: 'tpl.html'
},
files: {
'tpl/tpl.js': ['tpl/*.tpl.html']
},
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('eoraptor-jst');
grunt.registerTask('default', ['replace','uglify']);
grunt.registerTask('tpl', ['eoraptor_jst']);
};