Skip to content

Instantly share code, notes, and snippets.

@shovon
Created September 22, 2020 15:10
Show Gist options
  • Save shovon/27ef643c18c3fda6eebc150f494bb07c to your computer and use it in GitHub Desktop.
Save shovon/27ef643c18c3fda6eebc150f494bb07c to your computer and use it in GitHub Desktop.
Webpack config with web workers directly embedded in the JavaScript
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