-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use unique resource name with workerUrl
Append `?workerUrl=true` resource query to a "virtual" module created using `workerUrl()`. This intends to resolve an issue , where there're duplicate entries being generated in the source maps that reference the same resource path of imported worker script, which can not be represented in devtools accordingly. ``` // client-main.js.map ... "/foo/bar/src/worker.js" ... (Changes to => "/foo/bar/src/worker.js?workerUrl=true") "module.exports = __webpack_public_path__ + \"worker.js\"; // worker.js.map ... "/foo/bar/src/worker.js" ... "console.log('test worker');" ```
- Loading branch information
1 parent
141778c
commit cc467da
Showing
3 changed files
with
6 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...li/build/babel-plugins/babel-plugin-workerurl/test/fixtures/expected-import-destructuring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { workerUrl } from 'fusion-core'; | ||
import { workerUrl as workerUrlOther } from 'workerUrl'; | ||
const path = './test'; | ||
workerUrl(require("__SECRET_WORKER_LOADER__!./path")); | ||
workerUrl(require("__SECRET_WORKER_LOADER__!./path?workerUrl=true")); | ||
workerUrlOther(path); | ||
workerUrl(require("__SECRET_WORKER_LOADER__!./path")); | ||
workerUrl(require("__SECRET_WORKER_LOADER__!./path?workerUrl=true")); |
2 changes: 1 addition & 1 deletion
2
...build/babel-plugins/babel-plugin-workerurl/test/fixtures/expected-import-destructuring-as
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { workerUrl as frameworkWorkerUrl } from 'fusion-core'; | ||
import workerUrl from 'workerURL'; | ||
workerUrl('./path'); | ||
frameworkWorkerUrl(require("__SECRET_WORKER_LOADER__!./path")); | ||
frameworkWorkerUrl(require("__SECRET_WORKER_LOADER__!./path?workerUrl=true")); |