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

Limit of 48 exported files when using .pipe(browserSync #79

Open
Anima-t3d opened this issue Aug 30, 2017 · 3 comments
Open

Limit of 48 exported files when using .pipe(browserSync #79

Anima-t3d opened this issue Aug 30, 2017 · 3 comments

Comments

@Anima-t3d
Copy link

There seems to be a limit to how many files can be exported to the dist folder when ending a task with variations of .pipe(browserSync.stream({once: true})); It seems to be capped at 48 files per folder. Is there any known maximum or info on how to configure this number? I did not find anything online.

In my current project I am using handlebars to output to html files (more than 200 files) and I am using css stylesheets for components and for page specific overrides. Both seem to be capped at 48 per folder when using the code below:

gulp.task('serve', ['styles', 'pagesStyles', 'scripts', 'templates', 'pagesScripts'], () => {
  browserSync.init({
    server: paths.dist.root,
    open: false,
    notify: false,
		// files: [`${paths.dist.root}/**`],

    // Whether to listen on external
    online: false,
  });

	gulp.watch([paths.src.root + '/scss/**/*.scss', '!' + paths.src.pagesSass], ['styles', 'pagesStyles']);
  gulp.watch(paths.src.pagesSass, ['pagesStyles']);
  gulp.watch(paths.src.javascript, ['scripts']);
  gulp.watch(paths.src.pagesScript, ['pagesScripts']);
  gulp.watch(paths.src.templates, ['templates']);
  gulp.watch(paths.src.fonts, ['fonts']);
  gulp.watch(paths.src.files, ['files']);

	gulp.watch(`${paths.dist.root}/pages/*.html`).on('change', browserSync.reload);
});

Example for one of the tasks:

gulp.task('styles', () => {
  gulp.src([paths.src.sass])
    .pipe(sassGlob())
    .on('error', util.log)
    .pipe(sass({
      includePaths: ['src/scss'],
    }))
    .on('error', util.log)
    .pipe(prefixer('last 2 versions'))
    .on('error', util.log)
    .pipe(gulp.dest(paths.dist.css))
    // The moment you add any of the variations below it will stop creating files after 48 files in a specific folder
    // .pipe(browserSync.reload({stream: true}));
    // .pipe(browserSync.stream({match: '**/*.css', once: true}));

});

I have spent quite a few hours trying to get it to work before I realized this strange 48 file limit. Either I can get the reloading to work by using the .pipe(browserSync.stream()); but hit the file limit or I can export all files but no reloading...

Any help would be greatly appreciated!

@dabeedj
Copy link

dabeedj commented Apr 15, 2018

Hello.
Have you found any solution?
Thank you in advance

@Anima-t3d
Copy link
Author

@dabeedj are you experiencing the same issue? I ended up using sub directories to circumvent the limit, not having more than 48 files in a folder.

@dabeedj
Copy link

dabeedj commented Apr 17, 2018

@Anima-t3d yep, I have exactly the same. What I've done is just removed my img folder from being browserSynced so gulp watcher for this folder remained only. Now when I have a new/edited image in it - watcher do its job and all I need to do is to hit F5 in my browser manually

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