Skip to content

transparently require() jsx from within node witn babel

Notifications You must be signed in to change notification settings

Meettya/node-jsx-babel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

node-jsx-babel

Transparently require() jsx from node with babel

Breaking changes

This version change default extension from .js to .jsx, due to .js extension overwrite base node parser and will case an exception.

Usage

require('node-jsx-babel').install()

If you want to use a different extension than .jsx, do:

require('node-jsx-babel').install({extension: '.foo'})

If you want to couple with an additional transform (such as CoffeeScript), do:

var coffee = require('coffee-script');
require('node-jsx-babel').install({
  extension: '.coffee',
  additionalTransform: function(src) {
    return coffee.compile(src, {
      'bare': true
    });
  }
});

About target React version

This version was build for React v0.14 branch, with babel transformer.

Acknowledgment

Pete Hunt for base version of node-jsx

About

transparently require() jsx from within node witn babel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%