-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: check the
platform
property to determinate the target (#5269)
- Loading branch information
1 parent
6509a3f
commit c3b532c
Showing
8 changed files
with
209 additions
and
89 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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"use strict"; | ||
|
||
const myWorker = new Worker("./worker.js"); | ||
|
||
myWorker.onmessage = (event) => { | ||
console.log(`Worker said: ${event.data}`); | ||
}; | ||
|
||
myWorker.postMessage("message"); |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"use strict"; | ||
|
||
const HTMLGeneratorPlugin = require("../../helpers/html-generator-plugin"); | ||
|
||
module.exports = [ | ||
{ | ||
name: "app", | ||
dependencies: ["worker"], | ||
devtool: false, | ||
target: "web", | ||
entry: "./index.js", | ||
mode: "development", | ||
context: __dirname, | ||
stats: "none", | ||
output: { | ||
path: "/", | ||
}, | ||
infrastructureLogging: { | ||
level: "info", | ||
stream: { | ||
write: () => {}, | ||
}, | ||
}, | ||
plugins: [new HTMLGeneratorPlugin()], | ||
}, | ||
{ | ||
name: "worker", | ||
devtool: false, | ||
target: "webworker", | ||
entry: "./worker.js", | ||
mode: "development", | ||
context: __dirname, | ||
stats: "none", | ||
output: { | ||
path: "/", | ||
filename: "worker.js", | ||
}, | ||
infrastructureLogging: { | ||
level: "info", | ||
stream: { | ||
write: () => {}, | ||
}, | ||
}, | ||
}, | ||
]; |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"use strict"; | ||
|
||
postMessage("I'm working before postMessage"); | ||
|
||
onmessage = (event) => { | ||
postMessage(`Message sent: ${event.data}`); | ||
}; |