diff --git a/app/views/homepage/en.json b/app/views/homepage/en.json index 976447d..f8419b4 100644 --- a/app/views/homepage/en.json +++ b/app/views/homepage/en.json @@ -96,6 +96,9 @@ }, { "name": "MULTILANGUAGE SUPPORT", "text": "Add multiple languages to your project. Example: homepage" + }, { + "name": "ECMASCRIPT 6", + "text": "With the command of ./grabs es6 you can easily convert existing JavaScript codes from ECMAScript 6 to ECMAScript 5 automatically. You should also define your settings via traceur section which resides at gruntfile.js file." } ] } diff --git a/app/views/homepage/fr.json b/app/views/homepage/fr.json index 8b9621b..7816d26 100644 --- a/app/views/homepage/fr.json +++ b/app/views/homepage/fr.json @@ -96,6 +96,9 @@ }, { "name": "MULTI-LANGUE SUPPORT", "text": "Ajoutez plusieurs langues à votre projet. Exemple: accueil" + }, { + "name": "ECMASCRIPT 6", + "text": "With the command of ./grabs es6 you can easily convert existing JavaScript codes from ECMAScript 6 to ECMAScript 5 automatically. You should also define your settings via traceur section which resides at gruntfile.js file." } ] } diff --git a/app/views/homepage/tr.json b/app/views/homepage/tr.json index fb56dd1..2399e00 100644 --- a/app/views/homepage/tr.json +++ b/app/views/homepage/tr.json @@ -96,6 +96,9 @@ }, { "name": "ÇOKLU DİL DESTEĞİ", "text": "Projenize birden fazla dil seçeneği ekleyebilirsiniz. Örnek kullanım homepage sayfasında vardır." + }, { + "name": "ECMASCRIPT 6", + "text": "./grabs es6 komutuyla JavaScript kodlarınızı ECMAScript 6 versiyonundan, ECMAScript 5 versiyonuna otomatik çevirebilirsiniz. gruntfile.js dosyasındaki traceur alanından ayarlarınızı tanımlamalısınız." } ] } diff --git a/gruntfile.js b/gruntfile.js index aee7d1f..6d8897b 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -219,6 +219,26 @@ module.exports = function (grunt) { } } }, + // Traceur Doc: https://www.npmjs.com/package/grunt-traceur + traceur: { + options: { + experimental: true, + blockBinding: true, + moduleNaming: { + stripPrefix: "src/es6", + addPrefix: "com/grabs/project" + }, + copyRuntime: 'build/es6/' + }, + custom: { + files: [{ + expand: true, + cwd: 'app/es6/', + src: '*.js', + dest: 'build/es6/' + }] + } + }, notify_hooks: { options: { enabled: true, @@ -353,4 +373,8 @@ module.exports = function (grunt) { 'plato:report', 'connect:report' ]); + // $ grunt es6 + grunt.registerTask('es6', [ + 'traceur' + ]); }; diff --git a/package.json b/package.json index 5504310..fac635f 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,8 @@ "grunt-plato": "~1.3.0", "grunt-spritesmith": "~2.20.0", "grunt-template": "~0.2.3", - "load-grunt-tasks": "~0.6.0" + "grunt-traceur": "^0.5.1", + "load-grunt-tasks": "~0.6.0", + "traceur": "0.0.81" } }