wix-incubator / react-templates

Light weight templates for react
https://wix.github.io/react-templates
MIT License
2.82k stars 207 forks source link

Error during compilation to ES6 modules #157

Open kirylkastko opened 8 years ago

kirylkastko commented 8 years ago

If there html comments in .rt files, I always get an error: error Unknown node type ExportDefaultDeclaration

nippur72 commented 8 years ago

I did some debugging and it seems it's a bug from escodegen dependency.

See https://github.com/estools/escodegen/issues/263

nippur72 commented 8 years ago

The only thing we can do while waiting for it to be fixed, is to add a command line switch that turns off comments.

Any thoughts?

kirylkastko commented 8 years ago

Hi @nippur72 ,

Thank you for your investigation. I don't need comment in compiled code, so this solution works for me.

nippur72 commented 8 years ago

I've submitted a PR for this. Comments are simply turned off if output is ES6.

I've avoided the command line switch because it's likely we won't need it once the bug is fixed on the dependency.

If you need this feature before it's merged (which mike take a while) you can use install from my fork where I have all the unmerged PRs:

npm install git://github.com/nippur72/react-templates.git#gh-pages
kirylkastko commented 8 years ago

@nippur72 Thank you!