forked from s-panferov/awesome-typescript-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
72 lines (67 loc) · 1.98 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) {
require('load-grunt-tasks')(grunt);
var options = {
compiler: './node_modules/typescript/bin/tsc',
module: "commonjs",
fast: 'never',
preserveConstEnums: true,
target: 'es6'
};
var src = ['src/**/*.ts', '!src/test/fixtures/**/*'];
grunt.initConfig({
clean: ['dist'],
ts: {
default : {
options: options,
src: src,
outDir: 'dist'
},
watch : {
options: options,
src: src,
watch: ['src/'],
outDir: 'dist'
}
},
copy: {
main: {
src: './lib/runtime.d.ts',
dest: './dist/runtime.d.ts'
}
},
bump : {
options : {
files : ['package.json'],
updateConfigs : [],
commit : true,
commitMessage : 'chore(ver): v%VERSION%',
commitFiles : ['package.json', 'CHANGELOG.md'],
createTag : true,
tagName : 'v%VERSION%',
tagMessage : 'chore(ver): v%VERSION%',
push : true,
pushTo : 'origin',
gitDescribeOptions : '--tags --always --abbrev=1 --dirty=-d',
globalReplace : false,
prereleaseName : "rc",
regExp : false
}
},
shell : {
addChangelog : {
command : 'git add CHANGELOG.md'
}
},
changelog : {
options : {
}
}
});
grunt.registerTask("release", "Release a new version", function(target) {
if(!target) {
target = "minor";
}
return grunt.task.run("bump-only:" + target, "changelog", "shell:addChangelog", "bump-commit");
});
grunt.registerTask('default', ['ts:default', 'copy']);
};