amireh / happypack

Happiness in the form of faster webpack build times.
MIT License
4.23k stars 124 forks source link

Support raw of loaders #243

Open arthur791004 opened 5 years ago

arthur791004 commented 5 years ago

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

amireh commented 5 years ago

Thanks for the patch.

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