-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.old.js
More file actions
97 lines (91 loc) · 2.49 KB
/
Gruntfile.old.js
File metadata and controls
97 lines (91 loc) · 2.49 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
module.exports = function(grunt) {
var name, latest, bannerContent, devRelease, minRelease,
sourceMap, sourceMapUrl, lDevRelease, lMinRelease,
lSourceMapMin;
latest = '<%= pkg.name %>';
name = '<%= pkg.name %>-v<%= pkg.version%>';
bannerContent = '/*! <%= pkg.name %> v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> \n' +
' * License: <%= pkg.license %> */\n';
devRelease = 'dist/'+name+'.js';
minRelease = 'dist/'+name+'.min.js';
sourceMapMin = 'dist/'+name+'.min.js.map';
sourceMapUrl = name+'.min.js.map';
lDevRelease = 'dist/'+latest+'.js';
lMinRelease = 'dist/'+latest+'.min.js';
lSourceMapMin = 'dist/'+latest+'.min.js.map';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
//run buster task when ever a file in this paths changes
watch: {
files: ['Gruntfile.js','buster.js','src/**/*.js'],
tasks: 'buster'
},
//configure the buster task
buster: {
test: {
//path to the buster config file
config: 'buster.js'
},
server: {
port: 1111
}
},
// configure copy task
copy: {
development: {
src: devRelease,
dest: lDevRelease
},
minified: {
src: minRelease,
dest: lMinRelease
},
smMinified: {
src: sourceMapMin,
dest: lSourceMapMin
}
},
// configure uglify task
uglify:{
options: {
banner: bannerContent,
sourceMapRoot: '../',
sourceMap: sourceMapMin,
sourceMappingURL: sourceMapUrl
},
target: {
src: ['lib/jtypes-2.1.0.js','src/**/*.js', '!src/**/*.spec.js'],
dest: minRelease
}
},
// configure concat task
concat: {
options: {
banner: bannerContent
},
target: {
src: ['lib/jtypes-2.1.0.js','src/**/*.js', '!src/**/*.spec.js'],
dest: devRelease
}
},
// configure jshint task
jshint: {
options: {
trailing: true,
eqeqeq: true
},
target: {
src: ['src/**/*.js', 'test/**/*.js']
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-buster');
grunt.registerTask('build', ['jshint', 'concat', 'uglify', 'copy']);
//grunt.registerTask('test' ['buster']);
};