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

Not picking up all files #144

Open
darcys22 opened this issue Sep 28, 2015 · 0 comments
Open

Not picking up all files #144

darcys22 opened this issue Sep 28, 2015 · 0 comments

Comments

@darcys22
Copy link

gulp-usemin: 0.3.14
gulp-add-src: 0.2.0

I am trying to add my partials files with addSrc but within usemin it wont pick up all of them

gulp.task('without', [], function () {
return gulp.src(['public/assets/images/**/*','public/index.html'])
  .pipe(plugins.addSrc(['public/partials/**/*.html']))
  .pipe(plugins.debug())
 });
gulp.task('without2', [], function () {
return gulp.src(['public/index.html'])
  .pipe(plugins.addSrc(['public/partials/**/*.html']))
  .pipe(plugins.debug())
});
gulp.task('works', [], function () {
return gulp.src(['public/index.html'])
    .pipe(plugins.usemin({
        templateCache: [
            plugins.addSrc(['public/partials/**/*.html']),
            plugins.debug(),
        ]
    }))
});
gulp.task('broken', [], function () {
return gulp.src(['public/assets/images/**/*','public/index.html'])
    .pipe(plugins.usemin({
        templateCache: [
            plugins.addSrc(['public/partials/**/*.html']),
            plugins.debug(),
        ]
    }))
});

Without gulp-usemin I can get the files loaded fine, however within it if I have an array of globs in the original gulp.src then most of my partial files are missed. See my 'gulp broken' task:

➜  gulp without
[16:04:23] Using gulpfile ~/what/ui/gulpfile.js
[16:04:23] Starting 'without'...
[16:04:23] gulp-debug: ~/what/ui/public/assets/images/bg.png
[16:04:23] gulp-debug: ~/what/ui/public/partials/connect-local.html
[16:04:23] gulp-debug: ~/what/ui/public/assets/images/logo-sm.png
[16:04:23] gulp-debug: ~/what/ui/public/partials/landing.html
[16:04:23] gulp-debug: ~/what/ui/public/assets/images/logo.png
[16:04:23] gulp-debug: ~/what/ui/public/partials/login.html
[16:04:23] gulp-debug: ~/what/ui/public/partials/profile.html
[16:04:23] gulp-debug: ~/what/ui/public/index.html
[16:04:23] gulp-debug: ~/what/ui/public/partials/signup.html
[16:04:23] gulp-debug: 9 items
[16:04:23] Finished 'without' after 174 ms
➜  gulp without2
[16:04:28] Using gulpfile ~/what/ui/gulpfile.js
[16:04:28] Starting 'without2'...
[16:04:29] gulp-debug: ~/what/ui/public/index.html
[16:04:29] gulp-debug: ~/what/ui/public/partials/connect-local.html
[16:04:29] gulp-debug: ~/what/ui/public/partials/landing.html
[16:04:29] gulp-debug: ~/what/ui/public/partials/login.html
[16:04:29] gulp-debug: ~/what/ui/public/partials/profile.html
[16:04:29] gulp-debug: ~/what/ui/public/partials/signup.html
[16:04:29] gulp-debug: 6 items
[16:04:29] Finished 'without2' after 166 ms
➜  gulp works
[16:04:34] Using gulpfile ~/what/ui/gulpfile.js
[16:04:34] Starting 'clean'...
[16:04:34] Finished 'clean' after 15 ms
[16:04:34] Starting 'works'...
[16:04:34] gulp-debug: ~/what/ui/assets/javascript/templates.js
[16:04:35] Finished 'works' after 327 ms
[16:04:35] gulp-debug: ~/what/ui/public/partials/connect-local.html
[16:04:35] gulp-debug: ~/what/ui/public/partials/landing.html
[16:04:35] gulp-debug: ~/what/ui/public/partials/login.html
[16:04:35] gulp-debug: ~/what/ui/public/partials/profile.html
[16:04:35] gulp-debug: ~/what/ui/public/partials/signup.html
[16:04:35] gulp-debug: 6 items
➜  gulp broken
[16:04:38] Using gulpfile ~/what/ui/gulpfile.js
[16:04:38] Starting 'clean'...
[16:04:38] Finished 'clean' after 15 ms
[16:04:38] Starting 'broken'...
[16:04:39] gulp-debug: ~/what/ui/assets/javascript/templates.js
[16:04:39] Finished 'broken' after 326 ms
[16:04:39] gulp-debug: ~/what/ui/public/partials/profile.html
[16:04:39] gulp-debug: ~/what/ui/public/partials/signup.html
[16:04:39] gulp-debug: 3 items

The two file that get picked up are consistently the same. But if I rename the files then they will change. No idea what could be causing this.

Note: In my original code I had a function to test whether the src file was index.html before running usemin on it. Adding this back in does nothing however

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

1 participant