happypack icon indicating copy to clipboard operation
happypack copied to clipboard

Support raw of loaders

Open arthur791004 opened this issue 7 years ago • 1 comments

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

arthur791004 avatar Sep 16 '18 07:09 arthur791004

Thanks for the patch.

Will you be able to find the time to add some tests to cover it? Boring, I know, but! 😀

amireh avatar Oct 29 '18 03:10 amireh