Comments (6)
Thanks for the report. I haven't debugged anything here, but I think the issue is that glob-stream always starts at the cwd
and your cwd
is being changed to the location of the gulpfile.
Can you try adding an explicit cwd to your src? Something like { cwd: "../.." }
as the second argument
from glob-stream.
If the above proves to solve the issue, we may need to resolve the "most common directory" of all globs to start the walkdir 🤔
from glob-stream.
Blaine, thanks for your help!!! 🙏 🙏 🙏 🙏
Your tip cured the situation! 👍 👍 👍 👍
I've followed your tip and done this steps:
- set
src
relative to the project root - add
cwd: "../../"
as the optional (second) parameter src
done it's work smoothly
my actualgulpfile.js
, placed in theconfigs/gulp/gulpfile.js
(as previously), now looks like this:
Current gulpfile.js
config
import gulp from 'gulp';
const { src, dest, series } = gulp;
import include from 'gulp-file-include';
import replace from 'gulp-replace';
import rename from 'gulp-rename';
export function html() {
return src('projectName/src/pages/index_gulp_include.html', {
cwd: '../../',
})
.pipe(
include({
prefix: '@@',
indent: true,
}),
)
.pipe(replace(/="(\.\.\/){2,}/gi, '="../'))
.pipe(rename('index.html'))
.pipe(dest('../../projectName/src/pages/'));
}
The bash log
$ npx gulp --gulpfile ./configs/gulp/gulpfile.js html
[11:30:15] Working directory changed to E:\Code learning\boilerplate-webpack-gulp-html-scss-js-components\configs\gulp
[11:30:15] Using gulpfile E:\Code learning\boilerplate-webpack-gulp-html-scss-js-components\configs\gulp\gulpfile.js
[11:30:15] Starting 'html'...
[11:30:15] Finished 'html' after 351 ms
P.S. and especially thanks for clearing up how to use optional cwd
, root
parameters. My knowledge of gulp has been strengthened now 👍👍👍👍
from glob-stream.
As notice if you won't mind:
interesting thing but dest
is set to be relative to the current place of the gulpfile.js
and it works as expected (places bundled html
file to the projectName/src/pages/index.html
relative to the root). 🤔
from glob-stream.
I think it may be related to this bug: multilevel reinclusion don't work. With Gulp 4 I could properly chain an exclusion followed by a reinclusion, Gulp 5 doesn't reinclude the files that are an exception to an exclusion.
files: { src: [ './src/**/*.*', '!./src/vendor/**/*.*', './src/vendor/composer/**/*.*', './src/vendor/autoload.*', } };
from glob-stream.
I can confirm, that src
can no longer handle ../
at the beginning. This is the case when gulpfile is in a subdirectory like Build
and Resources
is outside of Build.
src('../Resources/Private/Sass/*')
no longer works
src('Resources/Private/Sass/*')
works
PS: dest
works sometimes with ../
at the beginning, but not in all cases.
from glob-stream.
Related Issues (20)
- How to properly read chunks of all files content into a single stream? HOT 3
- npm audit returns errors. HOT 5
- Update pumpify HOT 3
- [SPAM] Update glob-parent dependency to 5.1.2 or higher HOT 1
- glob-parent version vulnerability
- Bump glob-parent to resolve ReDos Vulnerability HOT 1
- Dependency vulnerability - Glob-parent HOT 1
- Switch to streamx
- Investigate fast-glob HOT 2
- Lists only 16 or less files when a glob string including no globstar. HOT 15
- BUG: UNC paths aren't resolved correctly HOT 1
- Snyk High Vulnerability: through [email protected]
- Updating from v8.0.0 to v8.0.1 causes RangeError: Maximum call stack size exceeded HOT 11
- v5 becomes significantly slower if a lot of NPM packages are installed HOT 5
- Gulp.dest fails to move files between filesystems in v5 HOT 1
- Gulp.src glob pattern fails in various edge situations HOT 3
- Sourcing files from a folder that doesn't exist using a glob pattern gives a cryptic error instead of nothing happening HOT 6
- Strange race condition on empy streams HOT 1
- File path after negative glob causes 'File not found with singular glob' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glob-stream.