question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exclude path from src not working ('!../folder')?

See original GitHub issue

Why is this '!../frontend/admin/modules/login/*.scss' ignored from the gulp.src([ … ]) list?

And by ignored I mean it still gets included ; )

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
42ttecommented, Aug 28, 2018

What were you expecting to happen? Expected excluded files in gulp.src to be excluded

What actually happened? Excluded files with …/ where not excluded on Mac/Linux, seems to work on Windows

Please post a sample of your gulpfile (preferably reduced to just the bit that’s not working)

gulp.task('jshint', function () {
    return gulp.src([
      '../src/app/scripts/**/*.js',
      '!../src/app/scripts/**/*.spec.js'
    ])
      .pipe(plugins.jshint())
      .pipe(plugins.jshint.reporter('default'));
  });

What version of gulp are you using? 4.0.0

What versions of npm and node are you using? npm 6.2.0 node 10.9.0

2reactions
42ttecommented, Aug 28, 2018

Can also be done with gulp.src cwd option gulp.src([ 'src/app/scripts/**/*.js', '!src/app/scripts/**/*.spec.js' ], { cwd: '../'});

But I’d prefer not to rewrite all my scripts

Read more comments on GitHub >

github_iconTop Results From Across the Web

git - .gitignore exclude folder but include specific subfolder
Usually you end up writing rules for this situation in pairs: ignore everything in a directory, but not some certain subdirectory.
Read more >
Control source, library, and exclude directories - CLion
To manage files and directories of your project, use the right-click menu in the Project tool window (to focus on it, press Alt+1...
Read more >
gitignore Documentation - Git
The optional configuration variable core.excludesFile indicates a path to a file containing patterns of file names to exclude, similar to $GIT_DIR/info/exclude ...
Read more >
excluding relative paths in duplicity - Unix Stack Exchange
For a src dir of a/b/c you could use --exclude */*/*/foo where the number of */ matches the src, but it is probably...
Read more >
Exclude a Folder from compilation with tsconfig.json in TS
Use the `exclude` option in your `tsconfig.json` file to exclude a folder from ... The contents of the src/example-nested directory would not be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found