Skip to content
Discussion options

You must be logged in to vote

Here example:

const path = require("path");
const webpack = require("webpack");

let workerEntry;

module.exports = [
	{
		devtool: false,
		mode: "development",
		name: "worker",
		target: "webworker",
		entry: "./src/worker.js",
		output: {
			path: path.join(__dirname, "dist-temp"),
			filename: "worker-[contenthash].js"
		},
		plugins: [
			{
				apply: compiler => {
					compiler.hooks.done.tap('MyWebpackPlugin', function(stats) {
						const entrypoints = stats.toJson().entrypoints;

						Object.keys(entrypoints).forEach((entryName) => {
							const entryFiles = entrypoints[entryName].assets;
							const entryFilename = entryFiles[0].name;

							if (!workerEntry && entryName === …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@thomastay
Comment options

Answer selected by thomastay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants