deepak1556 / gulp-browserify

Bundle modules with BrowserifyJS
MIT License
195 stars 45 forks source link

node_modules being included #83

Closed davidgilbertson closed 9 years ago

davidgilbertson commented 9 years ago

I know this is no longer maintained, but I hope someone can help.

I'm getting this message: [BABEL] Note: The code generator has deoptimised the styling of "g:/web/money-site/node_modules/jquery/dist/jquery.js" as it exceeds the max of "100KB". When running a gulp task using babelify.

The task is taking 40 seconds, I assume because it's going through node modules; I thought node_modules was ignored by default?

This is my gulp file:

var gulp = require('gulp');
var browserify = require('gulp-browserify');
var babelify = require('babelify');
var rename = require('gulp-rename');

gulp.task('js', function() {
    return gulp.src('app/client.js', { read: false })
        .pipe( browserify({ extensions: ['.jsx'], transform: ['babelify'] }) )
        .pipe( rename('main.js') )
        .pipe( gulp.dest('dist/') )
    ;
});

The owner of babelify says probably not an issue at their end: https://github.com/babel/babelify/issues/79

barneycarroll commented 9 years ago

@davidgilbertson this is exactly why you shouldn't rely on unmaintained plugins. It should be a matter of minutes to update your project build process to use Gulp & Browserify without this plugin, after which this bug will probably no longer exist, or at least you will be using maintained software and the community might be able to help with the specifics. This Gulp recipe could easily be tweaked to accommodate your situation. Alternatively, you may consider ditching Gulp altogether and simply using npm scripts – it looks like you could accomplish your js task with browserify --entry app/client.js --extension jsx --transform babelify --outfile dist/main.js

davidgilbertson commented 9 years ago

Thanks @barneycarroll. I've inherited a project using this setup and only discovered it wasn't maintained when I came to post the issue. In the end I used a similar recipe (but with babelify) to the one you linked to. As for ditching gulp: nope.

barneycarroll commented 9 years ago

@davidgilbertson ah man! Good luck. I really feel for whoever has to pick up my gulpfiles when I move on ;)