podio / requirejs-react-jsx

A RequireJS plugin for loading jsx in development and compiling (with r.js). Supports bundling and 1:1 source maps in development and production.
MIT License
104 stars 20 forks source link

Transformation issues #15

Closed cguinnup closed 8 years ago

cguinnup commented 8 years ago

React no longer seems to use JSXTransformer.

Following what the readme specifies for Babel, I'm still getting a RequireJS error "Script error for: JSXTransformer" even though I'm not requiring it anywhere in my code:

require.config({
    paths: {
        jsx: 'node_modules/requirejs-react-jsx/jsx',
        text: 'node_modules/requirejs-text/text',
        es6: 'node_modules/requirejs-babel/es6',
        babel: 'node_modules/requirejs-babel/babel-4.6.6.min'
    },

    shim: {
        'react': {
            'exports': 'React'
        }
    },

    config: {
        jsx: {
            fileExtension: '.jsx',
            transformer: 'babel',
            babelOptions: {
                sourceMaps: 'inline'
            }
        }
    }
});

require(['jsx!main'], function(Main) {
    Main();
});
cguinnup commented 8 years ago

Note: I'm trying to run my dev code in the Firefox browser, pre-build, like JSXTransform used to allow.

cguinnup commented 8 years ago

So I got it working with React 0.13.3 JSXTransformer. Still unclear how to use the latest version of React with this plugin.

cguinnup commented 8 years ago

Got it working by:

paths: {
...
JSXTransformer: libPath + 'babel/dist/browser',
...
}