Skip to content

serialization? #75

@yocontra

Description

@yocontra

Stumbled on it by noticing that my regex's were failing, but raises a larger issue:

Screen Shot 2019-08-15 at 12 18 36 PM

There are plenty of non-JSON values used in loader options that currently break when using thread-loader (regex, dates, functions). It seems like an easy solution would be to use a more comprehensive serialization method, or allow users to plug their own in. This will allow thread-loader to work with even more loaders and seems like a quick win.

I think this is the line in question: https://github.com/webpack-contrib/thread-loader/blob/b02d50367564fc81e8d5f28bfcfc7807831f7759/src/WorkerPool.js#L101

Quick glance shows a few libraries that handle this, I'm sure you could either do this internally or find a better one as well:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions