koistya / gulp-render

Pre-render React components at compile time. E.g. SomePage.jsx -> some-page.html
MIT License
26 stars 9 forks source link

ES6 Modules support #9

Closed tinkertrain closed 9 years ago

tinkertrain commented 9 years ago

I get this error when running the task, I'm using ES6 modules, are they supported?

import React from 'react';
^^^^^^
{ [SyntaxError: Unexpected reserved word]
  name: 'SyntaxError',
  message: 'Unexpected reserved word',
  stack: 'SyntaxError: Unexpected reserved word\n    at Module._compile (module.js:439:25)\n    at DestroyableTransform._transform (/Volumes/Macintosh HD/Sites/jsp

This is the render function:

var render = $.render({
      template: './src/templates/index.html',
      data: {title: 'Page Title'},
      harmony: true
    })
    .on('error', onError);

Cheers!

koistya commented 9 years ago

Nope, not in the original JSX transform. See JSX column here:

http://kangax.github.io/compat-table/es6/

tinkertrain commented 9 years ago

OK thanks!