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

Error when src and dest are the same when using multi level directories #235

Open
codedbypaul opened this issue Apr 20, 2017 · 0 comments
Open

Comments

@codedbypaul
Copy link

If you use gulp-useref with the same src and dest directories you get an error, although the files do actually get modified correctly.

My task is:

gulp.task('private:app:useref', () => {
      return gulp.src('./dist/**/*.html')
        .pipe(plugins.plumber())
        .pipe(plugins.useref())
        .pipe(gulp.dest('./dist/'));
    })

With this code in the html:

<!-- build:css /styles/style.min.css-->
<!-- inject:css-->
<link rel="stylesheet" href="/styles/style.css">
<!-- endinject-->
<!-- endbuild-->

The error message I get for each subdirectory html file is:

 Error: Error: File not found with singular glob: /dist/about/styles/style.css

Yet when you look at the index file in /about/ useref has done the right thing.

<link rel="stylesheet" href="/styles/style.min.css">

If you set gulp.dest to a different directory no error is reported.

Any ideas on how to make the error go away while still using the same src and dest directories?

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