Support raw of loaders
Problems
The loaders of webpack supports raw options to decide the input should be buffer or string.
If loaders set raw to true as follow:
export const raw = true;
// or
module.exports.raw = true;
Then, happypack should pass the content of file as buffer to them.
However, happypack currently only pass the content of file as string to each loader
Solutions
Using convertArgs which official utils, loader-runner, does to convert the content of file
Actually, there may be still some problems, for example, the format of gif may be broken after using happypack with image-webpack-loader, so the best solution is to introduce loader-runner to handle loaders
Related Issues
#114, #204, #233, #240
Thanks for the patch.
Will you be able to find the time to add some tests to cover it? Boring, I know, but! 😀