Skip to content

Commit

Permalink
add es6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
sercaneraslan committed Jan 20, 2015
1 parent 0aba89c commit 83f7d6c
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/views/homepage/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
}, {
"name": "MULTILANGUAGE SUPPORT",
"text": "Add multiple languages to your project. Example: <strong>homepage</strong>"
}, {
"name": "ECMASCRIPT 6",
"text": "With the command of <strong>./grabs es6</strong> you can easily convert existing JavaScript codes from ECMAScript 6 to ECMAScript 5 automatically. You should also define your settings via <strong>traceur</strong> section which resides at <strong>gruntfile.js</strong> file."
}
]
}
Expand Down
3 changes: 3 additions & 0 deletions app/views/homepage/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
}, {
"name": "MULTI-LANGUE SUPPORT",
"text": "Ajoutez plusieurs langues à votre projet. Exemple: <strong>accueil</strong>"
}, {
"name": "ECMASCRIPT 6",
"text": "With the command of <strong>./grabs es6</strong> you can easily convert existing JavaScript codes from ECMAScript 6 to ECMAScript 5 automatically. You should also define your settings via <strong>traceur</strong> section which resides at <strong>gruntfile.js</strong> file."
}
]
}
Expand Down
3 changes: 3 additions & 0 deletions app/views/homepage/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
}, {
"name": "ÇOKLU DİL DESTEĞİ",
"text": "Projenize birden fazla dil seçeneği ekleyebilirsiniz. Örnek kullanım <strong>homepage</strong> sayfasında vardır."
}, {
"name": "ECMASCRIPT 6",
"text": "<strong>./grabs es6</strong> komutuyla JavaScript kodlarınızı ECMAScript 6 versiyonundan, ECMAScript 5 versiyonuna otomatik çevirebilirsiniz. <strong>gruntfile.js</strong> dosyasındaki <strong>traceur</strong> alanından ayarlarınızı tanımlamalısınız."
}
]
}
Expand Down
24 changes: 24 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -353,4 +373,8 @@ module.exports = function (grunt) {
'plato:report',
'connect:report'
]);
// $ grunt es6
grunt.registerTask('es6', [
'traceur'
]);
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

0 comments on commit 83f7d6c

Please sign in to comment.