-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
35 lines (29 loc) · 879 Bytes
/
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
function modifyVersion() {
const package = require("./package.json");
let version = package.version || "1.0.0";
let arr = version.split(".");
arr[arr.length - 1] = (Number.parseInt(arr[arr.length - 1]) + 1).toString();
version = arr.join(".");
package.version = version;
const fs = require('fs');
let data = JSON.stringify(package, null, 4);
fs.writeFileSync("package.json", data, "utf8");
};
modifyVersion();
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
shell: {
src: {
command: `tsc -p src`
},
babel: {
command: "babel src -d out --extensions .ts"
},
webpack: {
command: "webpack"
}
}
});
grunt.registerTask('default', ["shell:src"]);
}