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
Presently, Webpack assumes that the worker.js script is located in the same location as the publicPath. The application I work on does not work like that, the worker script and the rest of the script files are located at two separate domains in order to satisfy the Same Origin worker requirement.
Webpack has a feature for making the publicPath a function, unfortunately it is a fairly obscure feature and I can't track down where it applies in the codebase. AFAIK it only applies in AssetGenerator.js to generate the hashes.
There was some work in #14680 to support Cross origin worker loading, however this is unrelated to this change. This PR will not solve cross origin workers. In fact the worker public path option has to be located at the same origin. In our app, the publicPath is a CDN domain, and the worker public path is the same-origin domain.
What kind of change does this PR introduce?
Adds in a new output option for the Worker script that tells Webpack where to expect the worker script to be.
Did you add tests for your changes?
Done
Does this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
New option. Documentation is already in the comments.
The text was updated successfully, but these errors were encountered:
A pull request by @thomastay was merged and maintainers requested a documentation change.
See pull request: webpack/webpack#16671
Presently, Webpack assumes that the worker.js script is located in the same location as the publicPath. The application I work on does not work like that, the worker script and the rest of the script files are located at two separate domains in order to satisfy the Same Origin worker requirement.
Webpack has a feature for making the publicPath a function, unfortunately it is a fairly obscure feature and I can't track down where it applies in the codebase. AFAIK it only applies in AssetGenerator.js to generate the hashes.
There was some work in #14680 to support Cross origin worker loading, however this is unrelated to this change. This PR will not solve cross origin workers. In fact the worker public path option has to be located at the same origin. In our app, the publicPath is a CDN domain, and the worker public path is the same-origin domain.
What kind of change does this PR introduce?
Adds in a new output option for the Worker script that tells Webpack where to expect the worker script to be.
Did you add tests for your changes?
Done
Does this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
New option. Documentation is already in the comments.
The text was updated successfully, but these errors were encountered: