Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Support raw of loaders #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

arthur791004
Copy link

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
Copy link
Owner

amireh commented Oct 29, 2018

Thanks for the patch.

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants