From 5abbda8671afd4ba05653277e72b6a3005acff03 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Tue, 4 Aug 2015 14:40:25 +0200 Subject: compile .jsx files --- server/sonar-web/Gruntfile.coffee | 17 ++++++++++++++++- server/sonar-web/package.json | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'server/sonar-web') diff --git a/server/sonar-web/Gruntfile.coffee b/server/sonar-web/Gruntfile.coffee index a495f84fdc1..d324e5b63fc 100644 --- a/server/sonar-web/Gruntfile.coffee +++ b/server/sonar-web/Gruntfile.coffee @@ -36,6 +36,17 @@ module.exports = (grunt) -> ] + babel: + build: + files: [ + expand: true + cwd: '<%= SOURCE_PATH %>/js' + src: ['**/*.jsx'] + dest: '<%= BUILD_PATH %>/js' + ext: '.js' + ] + + concat: build: files: @@ -300,6 +311,10 @@ module.exports = (grunt) -> files: '<%= SOURCE_PATH %>/js/**/*.js' tasks: ['copy:js', 'concat:build', 'copy:assets-all-js'] + jsx: + files: '<%= SOURCE_PATH %>/js/**/*.jsx' + tasks: ['babel:build', 'concat:build', 'copy:assets-all-js'] + handlebars: files: '<%= SOURCE_PATH %>/**/*.hbs' tasks: ['handlebars:build', 'copy:assets-all-js'] @@ -307,7 +322,7 @@ module.exports = (grunt) -> # Basic tasks grunt.registerTask 'prepare', - ['clean:css', 'clean:js', 'clean:build', 'less:build', 'handlebars:build', 'copy:js', 'concat:build'] + ['clean:css', 'clean:js', 'clean:build', 'less:build', 'handlebars:build', 'copy:js', 'babel:build', 'concat:build'] grunt.registerTask 'build-fast-suffix', ['copy:assets-css', 'copy:assets-all-js'] diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json index 44d05adaeac..f464079925c 100644 --- a/server/sonar-web/package.json +++ b/server/sonar-web/package.json @@ -3,6 +3,7 @@ "version": "0.0.1", "devDependencies": { "grunt": "0.4.5", + "grunt-babel": "5.0.1", "grunt-cli": "0.1.13", "grunt-concurrent": "1.0.0", "grunt-contrib-clean": "0.6.0", -- cgit v1.2.3