-
Notifications
You must be signed in to change notification settings - Fork 3
/
gruntfile.js
executable file
·72 lines (66 loc) · 2.06 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
69
70
71
72
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
default: {
src: [
'dist'
]
}
},
jshint: {
files: [
'src/**/*.js'
],
options: {
evil: true, // Suppress warnings about document.write
shadow: true,
globals: {
jQuery: true,
cornerstone: true
},
}
},
requirejs: {
compile: {
options: {
baseUrl: ".",
mainConfigFile: "config.js",
name: "src/widget.js",
out: "build/optimized.js"
}
}
},
concat: {
dist: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> ' +
'| (c) 2015 Erik Ziegler | https://github.com/swederik/cornerstoneWidget */\n'
},
src : ['node_modules/requirejs/require.js', 'build/optimized.js'],
dest: 'dist/cornerstoneWidget.js'
}
},
watch: {
scripts: {
files: ['src/**/*.js', 'test/*.js'],
tasks: ['jshint', 'concat:dist', 'requirejs']
}
},
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('buildAll', ['jshint', 'concat:dist', 'requirejs']);
grunt.registerTask('default', ['clean', 'buildAll']);
};
// Release process:
// 1) Update version numbers
// 2) do a build (needed to update dist versions with correct build number)
// 3) commit changes
// git commit -am "Changes...."
// 4) tag the commit
// git tag -a 0.1.0 -m "Version 0.1.0"
// 5) push to github
// git push origin master --tags