Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this be used with gulp-add-src? #156

Open
mcblum opened this issue Sep 23, 2016 · 1 comment
Open

Can this be used with gulp-add-src? #156

mcblum opened this issue Sep 23, 2016 · 1 comment

Comments

@mcblum
Copy link

mcblum commented Sep 23, 2016

We have some dependencies in Bower, some in NPM. For some reason the following isn't working:

gulp.task('vendor', function () {

    // define our filters
    var jsFilter = gulpFilter(['**/*.js'], {
        restore: true
    });
    var cssFilter = gulpFilter(['**/*.css'], {
        restore: true
    });

    return gulp.src(mainBowerFiles({
        paths: {
            bowerDirectory: src.bower + 'bower_components',
            bowerJson: src.bower + 'bower.json'
        }
    }))
        .pipe(jsFilter)
        .pipe(addsrc([
            './node_modules/hoshi/dist/hoshi.js',
            './node_modules/angular-gsapify-router/angular-gsapify-router.js',
            './node_modules/hoshiImageLoader/dist/main.min.js',
            './node_modules/hoshiCustomContent/dist/main.min.js',
            './node_modules/headroom.js/dist/headroom.min.js',
            './node_modules/headroom.js/dist/angular.headroom.min.js'
        ]))
        .pipe(concat('vendor.js'))
        .pipe(gulpif(util.env.production, uglify()))
        .pipe(gulp.dest(dist.js))
        .pipe(jsFilter.restore)
        .pipe(cssFilter)
        .pipe(concat('vendor.css'))
        .pipe(gulpif(util.env.production, cssnano()))
        .pipe(gulp.dest(dist.css))
});

It's finding all of the main Bower files but none of my manual includes. Any idea why that would be?

Thanks for your hard work on this library!

@TrySound
Copy link
Collaborator

All this plugin do is looking for files. This function works well as you said. Your issue relates to gulp-add-src or gulp itself, not this module.

Are you sure your gulpfile.js and node_modules are placed in the same directory?
Also you better split js and css task, caz they have nothing common except main-bower-files, but you may call it twice and use css and js filter option in it.

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

No branches or pull requests

2 participants