You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
When webpack bundles this, the browser correctly and successfully loads the main worker from 'dist/main.worker.js', however it then tries to load the subworker from 'dist/dist/sub.worker.js' which isn't where the worker bundle was built to.
I'm not sure if this is a config problem on my side or an issue with the plugin. Here are the relevant parts of my webpack config:
Thanks. I had tried that (successfully) but I want the URLs to be relative to my page rather than the root. I can't assume which URL the app will be loaded from.
Activity
developit commentedon Jul 16, 2019
Hi there! You need to set your
output.publicPathto an absolute URL:{ entry: ['./src/index.js'], output: { path: path.join(__dirname, 'dist'), filename: '[name].js', - publicPath: 'dist/' + publicPath: '/dist/' }, plugins: [ new WorkerPlugin({ filename: '[name].worker.js' }) ] }It might be possible to address this in
worker-plugin, but I'm not sure.jamiewinder commentedon Jul 17, 2019
Thanks. I had tried that (successfully) but I want the URLs to be relative to my page rather than the root. I can't assume which URL the app will be loaded from.
developit commentedon Jul 26, 2019
@jamiewinder I'm not sure if it will work in the worker context, but you could set the public path dynamically at runtime (more info here):