Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Can't be loaded by webpack #126
I am trying to load JSONStream through webpack but failed with below error:
I found that the first line of
you should file this as a bug in webpack. I am sure there are loads of other modules that have this, and this is a very popular module that has been this way for a long time, it would be much easier to fix this in webpack than to fix every module which uses this. Browserify can handle this, btw.
There are few but not many. At least not libs that aim to work in both node as well as browser. And it doesn't work on Windows as well.
There is no value in the hash bang. Node JS will interpret it correctly either way. I doubt webpack will ever address it, since its not a webpack issue technically. Its one of those issues which can be argued to death either which way.
In the end, it boils down to this - Do you envision the greater use case of this lib as a shell script or as a node package? Do you want this lib to be restricted to "linux+node" only environment (for having that 1 line) or do you want to open it up to much larger audience (and get rid of the line).
For folks looking for work-around: