/gulp_browserify_es6_babel_react

Getting started with ES6, Gulp, Babel, Browserify, React!

Primary LanguageJavaScript

###Getting started with ES6, Gulp, Babel, Browserify, React!

This repo was created to resolve the following issue:

http://stackoverflow.com/questions/34848085/react-es6-compiling-with-browserify-babel-and-gulp-issue-importing-components

You should be good just doing:

npm install

gulp

Props for Henrik Andersson who came up with the solution:

You're creating multiple entry points for your app in your gulpfile.babel.js (Basically, you're creating two bundles).

const paths = { src: './src', publicSrc: './public/js', dest: './app', bundle: 'bundle.js', bundleDest: './app/public/js', publicEntries: [ './public/js/index', './public/js/components/test' <--- Remove this line. ] };

> Browserify traverses all of your require calls (Babel transforms the import ... to require) and pieces them together when producing the bundle. Having multiple entry points are only used if you want to have one bundle for url /x and another bundle for /y.