Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Feb 4, 2017
1 parent f4befec commit 42429dc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/compiler.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* The riot-compiler v3.1.2
* The riot-compiler WIP
*
* @module compiler
* @version v3.1.2
* @version WIP
* @license MIT
* @copyright Muut Inc. + contributors
*/
Expand Down Expand Up @@ -997,5 +997,5 @@ module.exports = {
css: compileCSS,
js: compileJS,
parsers: parsers,
version: 'v3.1.2'
version: 'WIP'
}
34 changes: 34 additions & 0 deletions src/parsers_br.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,42 @@ var parsers = (function (win) {
}
}
_p.js = {
// Babel should be handled differently depending on the environement where we are
es6: function (js, opts, url) {
/*#if NODE */
return _r('babel').transform(js, extend({ filename: url }, opts)).code
//#else */
return _r('Babel').transform( // eslint-disable-line
js,
extend({
filename: url,
plugins: [
['transform-es2015-template-literals', { loose: true }],
'transform-es2015-literals',
'transform-es2015-function-name',
'transform-es2015-arrow-functions',
'transform-es2015-block-scoped-functions',
['transform-es2015-classes', { loose: true }],
'transform-es2015-object-super',
'transform-es2015-shorthand-properties',
'transform-es2015-duplicate-keys',
['transform-es2015-computed-properties', { loose: true }],
['transform-es2015-for-of', { loose: true }],
'transform-es2015-sticky-regex',
'transform-es2015-unicode-regex',
'check-es2015-constants',
['transform-es2015-spread', { loose: true }],
'transform-es2015-parameters',
['transform-es2015-destructuring', { loose: true }],
'transform-es2015-block-scoping',
'transform-es2015-typeof-symbol',
['transform-es2015-modules-commonjs', { allowTopLevelThis: true }],
['transform-regenerator', { async: false, asyncGenerators: false }]
]
},
opts
)).code
//#endif
},
buble: function (js, opts, url) {
opts = extend({
Expand Down

0 comments on commit 42429dc

Please sign in to comment.