Closed stephenjason89 closed 4 years ago
I believe this should work without any configuration:
new Worker("./calculate-primes.js", {
type: "module",
name: "workers/calculate-primes",
});
FWIW this plugin will use output.chunkFilename
if you define it:
output: {
path: path.join(__dirname, 'public/js'),
filename: '[name].js',
chunkFilename: 'chunks/[name].js', // <-- public/js/chunks/calculate-primes.worker.js
},
Thank you sir.
im using laravel mix and by default it places the file at public directory
here's my webpack Config
.webpackConfig({ plugins: [ new WorkerPlugin({ filename: '[name].worker.js' }) ], });
if i use the output
output: { path: path.join(__dirname, 'public/js/workers'), },
It places all my files there including my app.js which i don't want
Thank you for the help