Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

react preset is not working #67

Open
kesavkolla opened this issue Oct 13, 2016 · 1 comment
Open

react preset is not working #67

kesavkolla opened this issue Oct 13, 2016 · 1 comment

Comments

@kesavkolla
Copy link

I've the following config

    SystemJS.config({
        defaultJSExtensions: true,
        meta: {
            '*.jsx': {
                'loader': 'plugin-babel',
                'format': 'cjs',
                'babelOptions': {
                    'modularRuntime': false,
                    stage1: true,
                    presets: ['babel-preset-react']
                }
            }
        },
        map: {
            'plugin-babel': 'unpkg:systemjs-plugin-babel@latest/plugin-babel.js',
            'systemjs-babel-build': 'unpkg:systemjs-plugin-babel@latest/systemjs-babel-browser.js',
            'babel-preset-react': 'npm:babel-preset-react',
            'react': 'unpkg:react@15.3.2/dist/react.min.js',
            'react-dom': 'unpkg:react-dom@15.3.2/dist/react-dom.min.js',
            'react-bootstrap': 'unpkg:react-bootstrap@0.30.5/dist/react-bootstrap.min.js'
        },
        transpiler: 'plugin-babel',
        paths: {
            '*': 'https://registry.jspm.io/*.js',
            'npm:*': 'https://npm.jspm.io/*.js',
            'github:*': 'https://github.jspm.io/*.js',
            'unpkg:*': 'https://unpkg.com/*',
        },
        packages: {
            'unpkg:*': {
                defaultExtension: false
            },
            './': {
                defaultExtension: false
            }
        }
    });
    SystemJS.import('./app.jsx').then(function (m) {
        console.log(m);
    });

image

@aufula
Copy link

aufula commented May 10, 2017

@kesavkolla same issue. finally, figure out by myself. try this config

    SystemJS.config({
        baseURL:'https://unpkg.com/',
        defaultExtension: true,
        meta: {
            '*.jsx': {
                'babelOptions': {
                    react: true
                }
            }
        },
        map: {
            'plugin-babel': 'systemjs-plugin-babel@latest/plugin-babel.js',
            'systemjs-babel-build': 'systemjs-plugin-babel@latest/systemjs-babel-browser.js',
            'react': 'react@15.3.2/dist/react.min.js',
            'react-dom': 'react-dom@15.3.2/dist/react-dom.min.js'
        },
        transpiler: 'plugin-babel'
    });


    SystemJS.import('./comp-a.jsx').then(function (m) {
        console.log(m);
    });

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

No branches or pull requests

2 participants