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.

Files are read from file system instead vinyl

See original GitHub issue

I’m using webpack-stream with gulp-preprocess, and in some file I have a someVar = /* @echo CONFIG */ which is processed by gulp-preprocess and become someVar = { foo: "bar" } in order to expose the configuration to the client. But I noticed that webpack-stream is just reading the contents from the original file in the file system instead the processed, so babel-loader gives syntax error, since someVar = /* @echo CONFIG */ is not valid javascript.

I created this sample repo to easily reproduce the problem.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:12
  • Comments:9

github_iconTop GitHub Comments

1reaction
YodasWscommented, Nov 25, 2017

Or, better yet, you’ll have to run two tasks in series:

gulp.task('build', gulp.series(
  ()=>{
    return gulp.src('src/app.js')
      .pipe(replaceString())
      .pipe(gulp.dest('build/'))
  },
  ()=>{
    return gulp.src('build/app.js')
      .pipe(named())
      .pipe(webpack())
      .pipe(gulp.dest('docs/'))
  }
);
0reactions
DamianoMagrinicommented, Jun 14, 2019

In the meanwhile, I’ve made my own plugin that actually uses the file system that was passed into it instead of fs. You can see it here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gulpjs/vinyl-fs: Vinyl adapter for the file system. - GitHub
Returns a stream of vinyl File objects. Note: UTF-8 BOM will be removed from all UTF-8 files read with .src unless disabled in...
Read more >
Vinyl | gulp.js
A virtual file format. When a file is read by src() , a Vinyl object is generated to represent the file - including...
Read more >
README.md - Leonard
[Vinyl][vinyl] is a very simple metadata object that describes a file. ... __Note: UTF-8 BOM will be removed from all UTF-8 files read...
Read more >
Files-11 - Wikipedia
Files-11 is the file system used by Digital Equipment Corporation OpenVMS operating system, and also (in a simpler form) by the older RSX-11....
Read more >
Gulp - Handle read-only permissions for dest files?
I wanted to clarify to myself that it does not work on the file system but on the (yet-to-be-written-to-the-file-system-via-.dest) vinyl files in the...
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