Skip to content

Conversation

@cromefire
Copy link

Allows for better and clearer use, so that there is no implicit (hidden from the user) new Worker() happening.

@cromefire
Copy link
Author

cromefire commented May 24, 2020

Usage in plain js:

const options = {
    workerConstructor() {
        return new Worker("path/to/file.js");
    },
    legacyWorkerConstructor() {
        return new Worker("path/to/file.js");
    },
    [...]
}

With worker-plugin:

const options = {
    workerConstructor() {
        return new Worker("./file.ts", {type: "module"});
    },
    legacyWorkerConstructor() {
        return new Worker("./file.ts", {type: "module"});
    },
    [...]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant