Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove babel-register #16

Open
danneu opened this issue Apr 20, 2018 · 0 comments
Open

Remove babel-register #16

danneu opened this issue Apr 20, 2018 · 0 comments

Comments

@danneu
Copy link
Owner

danneu commented Apr 20, 2018

I was too eager to test my react-template-render library in koa-skeleton and thus replaced my Pug templates with .jsx templates. But now I need Babel to compile .jsx into .js.

The easiest solution was to use babel-register:

require('babel-register')({
presets: ['react'],
extensions: ['.jsx'],
})

But it brings a thick runtime dependency, probably slows down large project boot, and probably degrades the quality of stack traces.

Better would be to compile .jsx to .js physically with a watch script.

It's kind of lame to have a build step at all on a server, but so far .jsx templates have been worth it. Prob on par with what I had with Pug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant