Created
September 22, 2020 15:10
-
-
Save shovon/27ef643c18c3fda6eebc150f494bb07c to your computer and use it in GitHub Desktop.
Webpack config with web workers directly embedded in the JavaScript
This file contains hidden or 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
const path = require("path"); | |
module.exports = { | |
entry: "./src/index.js", | |
output: { | |
path: path.resolve(__dirname, "dist"), | |
filename: "bundle.js", | |
libraryTarget: "commonjs", | |
}, | |
devtool: "source-map", | |
module: { | |
rules: [ | |
{ | |
test: /\.worker\.js$/, | |
loader: "worker-loader", | |
options: { | |
inline: "no-fallback", | |
}, | |
}, | |
], | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment