Skip to content

Commit

Permalink
Add typescript build phase
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph-D committed Jun 21, 2016
1 parent 717b118 commit ba043fd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/node_modules
/build
/.tscache/
/src/.baseDir.ts
/tscommand*
16 changes: 13 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = function(grunt) {
atBegin: true
},
gravi: {
files: [ "<%= srcDir %>/*.js" ],
files: [ "<%= srcDir %>/*.{js,ts}" ],
tasks: [ "compile", "karma:single-test" ]
},
site: {
Expand Down Expand Up @@ -86,7 +86,7 @@ module.exports = function(grunt) {
gravi: {
expand: true,
flatten: true,
src: "<%= srcDir %>/*.js",
src: [ "<%= srcDir %>/*.js", "<%= buildDir %>/js/ts/*.js" ],
dest: "<%= buildDir %>/js"
},
test: {
Expand All @@ -99,6 +99,15 @@ module.exports = function(grunt) {
sourceMap: true
}
},
ts: {
gravi: {
src: "<%= srcDir %>/*.ts",
dest: "<%= buildDir %>/js/ts",
options: {
target: "es6"
}
}
},
eslint: {
gravi: {
src: ["<%= srcDir %>/*.js"]
Expand All @@ -119,8 +128,9 @@ module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-shell");
grunt.loadNpmTasks("grunt-karma");
grunt.loadNpmTasks("grunt-babel");
grunt.loadNpmTasks("grunt-ts");

grunt.registerTask("compile", [ "babel:gravi", "eslint:gravi" ]);
grunt.registerTask("compile", [ "ts:gravi", "babel:gravi", "eslint:gravi" ]);
grunt.registerTask("build-site", [ "less", "postcss", "copy" ]);
grunt.registerTask("build", [ "compile", "build-site" ]);
grunt.registerTask("minify", [ "compile", "requirejs:gravi" ]);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"grunt-karma": "^2.0.0",
"grunt-postcss": "^0.8.0",
"grunt-shell": "^1.3.0",
"grunt-ts": "^5.5.1",
"gruntify-eslint": "^2.0.0",
"jasmine-core": "^2.4.1",
"karma": "^0.13.22",
Expand Down

0 comments on commit ba043fd

Please sign in to comment.