es6-module-loader: using traceur to only transpile modules

51 views
Skip to first unread message

Owen Densmore

unread,
Mar 1, 2016, 3:41:28 PM3/1/16
to traceur-compiler-discuss
The es6-module-loader dynamically supports <script type="module"> using traceur as its transpiler:

Because Canary is > 95% es6 complete, I would like to configure traceur to transpile *only* import/export modules.

I tried doing this with the options below, which failed .. producing several errors.

Is there a way to configure traceur to only transpile modules? Should this work?

System.traceurOptions = { arrowFunctions: false, blockBinding: false, classes: false, computedPropertyNames: false, defaultParameters: false, destructuring: false, forOf: false, generators: false, numericLiterals: false, propertyMethods: false, propertyNameShorthand: false, restParameters: false, spread: false, symbols: false, templateLiterals: false, unicodeEscapeSequences: false, unicodeExpressions: false }

John J Barton

unread,
Mar 1, 2016, 8:58:41 PM3/1/16
to traceur-comp...@googlegroups.com
Setting the options false should work.  If you open an issue with the example and errors I'll take a look.

It sounds like you want --outputLanguage=es6.

jjb

--
You received this message because you are subscribed to the Google Groups "traceur-compiler-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to traceur-compiler-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Owen Densmore

unread,
Mar 7, 2016, 12:33:42 PM3/7/16
to traceur-compiler-discuss
On Tuesday, March 1, 2016 at 6:58:41 PM UTC-7, johnjbarton wrote:
Setting the options false should work.  If you open an issue with the example and errors I'll take a look.

It sounds like you want --outputLanguage=es6.

jjb

Hi John. Thanks for the suggestion.

There is demo code and discussion in an issue for the module loader:

How would I put your option into the System.traceurOptions object? Just add outputLanguage:"es6" to the others?

System.traceurOptions = { arrowFunctions: false, blockBinding: false, classes: false, computedPropertyNames: false, defaultParameters: false, destructuring: false, forOf: false, generators: false, numericLiterals: false, propertyMethods: false, propertyNameShorthand: false, restParameters: false, spread: false, symbols: false, templateLiterals: false, unicodeEscapeSequences: false, unicodeExpressions: false };

John J Barton

unread,
Mar 7, 2016, 7:14:50 PM3/7/16
to traceur-comp...@googlegroups.com
No, remove all of the other options, include only outputLanguage: es6.

Reply all
Reply to author
Forward
0 new messages