Skip to content

Use compiler's inputFileSystem for reading the source files and sourcemaps. #3

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

Closed
wants to merge 1 commit into from

Conversation

Arnavion
Copy link

Fixes #2

@sokra
Copy link
Member

sokra commented Jan 25, 2015

Yeah... I see what you want to do...

But _compiler is a private API, so we better expose the inputFileSystem as this.fs to loaders. Would you like to do a PR there. This affects more loaders as many of them use require("fs"). this.fs could automatically track dependencies too...

@Arnavion
Copy link
Author

That makes sense. I'll do that.

Edit: webpack/webpack#732

@fzaninotto
Copy link

It doesn't seem to be enough. Although a webpack build on fs works, with your patch a webpack-dev-server fails with the following error:

        callbacks[i].apply(null, args);
                     ^
TypeError: undefined is not a function
    at Storage.finished (path/to/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:38:16)
    at evalmachine.<anonymous>:334:14
    at path/to/node_modules/webpack/node_modules/enhanced-resolve/node_modules/graceful-fs/graceful-fs.js:102:5
    at FSReqWrap.oncomplete (evalmachine.<anonymous>:95:15)

@Arnavion
Copy link
Author

@fzaninotto Sorry, I don't use webpack any more so I'm not going to push for this. Maybe try seeing what exactly callback[i] is (presumably not a function) and how it came to be there.

cjc343 pushed a commit to cjc343/source-map-loader that referenced this pull request Apr 7, 2016
@Strate
Copy link

Strate commented Apr 15, 2016

What's here? Why just not to merge it?

@jedwards1211
Copy link

@sokra if _compiler is private API for loaders but not for plugins, perhaps this should be some sort of plugin/loader hybrid instead?

@Arnavion
Copy link
Author

I'm not using webpack any more and have no idea if this PR is still valid or not, so I'm closing it. If someone else needs it please feel free to submit your own PR.

@Arnavion Arnavion closed this Sep 19, 2016
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

Successfully merging this pull request may close these issues.

This uses node fs directly to read JS and sourcemap files
5 participants