-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support
devServer: false
(#5272)
- Loading branch information
1 parent
06005e7
commit 8b341cb
Showing
10 changed files
with
151 additions
and
17 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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-bundle.js"); | ||
|
||
myWorker.onmessage = (event) => { | ||
console.log(`Worker said: ${event.data}`); | ||
}; | ||
|
||
myWorker.postMessage("message"); |
47 changes: 47 additions & 0 deletions
47
test/fixtures/worker-config-dev-server-false/webpack.config.js
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,47 @@ | ||
"use strict"; | ||
|
||
const path = require("path"); | ||
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: path.resolve(__dirname, "./dist/"), | ||
}, | ||
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: path.resolve(__dirname, "public"), | ||
filename: "worker-bundle.js", | ||
}, | ||
infrastructureLogging: { | ||
level: "info", | ||
stream: { | ||
write: () => {}, | ||
}, | ||
}, | ||
devServer: false, | ||
}, | ||
]; |
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}`); | ||
}; |