Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

feat: use target webworker #490

Merged
merged 1 commit into from
Sep 3, 2019
Merged

feat: use target webworker #490

merged 1 commit into from
Sep 3, 2019

Conversation

xtuc
Copy link
Member

@xtuc xtuc commented Aug 30, 2019

Fixes #477. We want to
configure webpack to emit only webworker compatible code.

@xtuc xtuc added regression Something is broken, but works in previous releases webpack Issues that involve the `webpack` bundler labels Aug 30, 2019
@xtuc xtuc mentioned this pull request Aug 30, 2019
@xtuc xtuc requested a review from a team August 30, 2019 12:26
@@ -28,6 +28,15 @@ if (args["no-webpack-config"] === "1") {
config = require(join(process.cwd(), args["webpack-config"]));
}

if (config.target !== undefined && config.target !== "webworker") {
throw error(
"Building a Cloudflare Worker with target " + JSON.stringify(config.target) +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use string literals here? Also putting a stringified JSON in the middle of an error message seems... interesting. Do you have an example of what this would output?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's adding quotes arround string, normalize priting functions, NaN, undefined, etc.

@dihmeetree
Copy link

LGTM <3

@xtuc xtuc requested a review from a team September 2, 2019 16:15
tests/build.rs Outdated Show resolved Hide resolved
Fixes #477. We want to
configure webpack to emit only webworker compatible code.
@xtuc xtuc merged commit abf944d into master Sep 3, 2019
@delete-merged-branch delete-merged-branch bot deleted the feat-use-target-webworker branch September 3, 2019 15:12
@kristianfreeman kristianfreeman added feature Feature requests and suggestions changelog - feature labels Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests and suggestions regression Something is broken, but works in previous releases webpack Issues that involve the `webpack` bundler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use target: webworker
5 participants