Comments (1)
It doesn't look like the file.clone() by its self actually deep clones the data. For the record, this fixes my immediate issues:
function clonedata() {
return through.obj(function (file, enc, cb) {
var f = file.clone();
f.data = JSON.parse(JSON.stringify(f.data));
cb(null, f);
});
}
gulp.task("test", function() {
var a = gulp.src(files)
.pipe(data(function(file) { return { foo: "bar" }; }));
var b = a
.pipe(clonedata())
.pipe(rename("something.else"))
.pipe(data(function(file) { return { foo: "baz" }; }));
return merge(a, b)
.pipe(gulp.dest("./dist/"));
}
from gulp-data.
Related Issues (19)
- Doesn't work with multiple gulp sources
- Please provide a cache option HOT 2
- path issue HOT 3
- A way to ignore if file doesnt exist HOT 1
- JSON not updating. HOT 2
- Reload data with browsersync when modify json HOT 1
- Examples of using gulp-data with json files and watch HOT 14
- Who uses gulp-data? HOT 1
- gulp-data not throwing errors (with gulp-jade) HOT 2
- Consider using through2-parallel
- How can i append the data to an existing JSON file? HOT 1
- Using multiple json files with extended arrays HOT 7
- Empty HTML
- Replace deprecated dependency gulp-util
- auto-reload browser when changing data.json
- Any plan for YAML support? HOT 1
- Extend data instead of setting it HOT 2
- util-extend is only declared in dev dependencies but is used by production code HOT 1
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 gulp-data.