Open arthur791004 opened 5 years ago
The loaders of webpack supports raw options to decide the input should be buffer or string.
raw
buffer
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
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
gif
Thanks for the patch.
Will you be able to find the time to add some tests to cover it? Boring, I know, but! 😀
Problems
The loaders of webpack supports
raw
options to decide the input should bebuffer
orstring
.If loaders set
raw
to true as follow: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 loadersRelated Issues
114, #204, #233, #240