Created
March 6, 2016 01:14
-
-
Save ro31337/89429b7cc8f9033a3e24 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // convert React components to be used in the browser | |
| gulp.task('browserify', function() { | |
| var babelifyConfig = babelify.configure({presets: ['es2015', 'react'], extensions: ['.jsx']}); | |
| return browserify({ | |
| entries: 'src/app.jsx', // the same as "--extension=.jsx src/**/*.jsx" | |
| extensions: ['.jsx'] | |
| }) | |
| .transform(babelifyConfig) // the same as -t command line parameter | |
| .bundle() // "readable stream with the javascript file contents" | |
| .pipe(source('bundle.js')) // "conventional text stream at the start of our gulp pipeline", wrapped with "pipe" method | |
| .pipe(gulp.dest('dist/bundle.js')); // standard gulp way to redirect gulp pipe to directory | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment