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

Injections using opt.name in files without tag still output results #184

Closed
ccampanale opened this issue May 17, 2016 · 0 comments
Closed

Comments

@ccampanale
Copy link

I may be missing something but I've searched and can't seem to find any information on this, so if I'm nuts please just point me in the right direction:

As the title says, injections using opt.name in files without the named tag still output results that files were inject while this is - from my perspective - technically incorrect.

Example task:

var sitefiles = {
  login: {
    css: [
      'userportal/assets/css/*.css',
    ],
    js: [
      'userportal/assets/js/jquery-1.8.3.min.js',
    ]
  },
  header: {
    css: [
      'userportal/assets/css/*.css',
    ],
    js: [
      'userportal/assets/js/jquery*.js',
    ]
  }
}

gulp.task('revreplace', 'Inject all prepared stylesheets and scripts into application code for fresh build', ['scripts', 'styles'], function(){
  return gulp.src('./userportal/*.php')
    .pipe(inject(gulp.src(sitefiles.header.css, {read: false}), {name: 'head',  relative: true}))
    .pipe(inject(gulp.src(sitefiles.login.css,  {read: false}), {name: 'login', relative: true}))
    .pipe(inject(gulp.src(sitefiles.header.js,  {read: false}), {name: 'head',  relative: true}))
    .pipe(inject(gulp.src(sitefiles.login.js,   {read: false}), {name: 'login', relative: true}))
    .pipe(gulp.dest('userportal'));
});

As you can see this task uses a gulp.src that is a glob of files and I am using an object sitefiles to define some dynamic and static file locations to inject into specific files as they are found. In this example only the login.php and header.php actually have named tags for injection in them while the rest of the parsed php files do not (yet). So really only a handful of files - both .css and .js - get injected ONLY into these two files while the rest of the files get nothing injected however I still see output for other files that reads [21:19:45] gulp-inject 3 files into index.php. for instance.

I feel like this should not be the case but can't see how to suppress this other then setting opt.quiet:true but I rather like getting the output for which files received injections just not if it's not really got information for me and reports on all the files.

Again, please set me straight if I'm bat-shit-crazy. Thanks!

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