Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourcemap is not propagated for worker file #88

Closed
rjgotten opened this issue May 12, 2020 · 1 comment
Closed

sourcemap is not propagated for worker file #88

rjgotten opened this issue May 12, 2020 · 1 comment

Comments

@rjgotten
Copy link

If the source for the worker is treated by other loaders first, e.g. by Babel, then the sourcemap flowing out of those loaders is not propagated correctly by the rpc-worker-loader.

A minimal required and working change is trivial.
Instead of

function rpcWorkerLoader(content) {
  return content + workerScript;
}

do

function rpcWorkerLoader(content, sourcemap) {
  const cb = this.async();
  cb(null, content + workerScript, sourcemap);
}

Though technically, the new lines added by workerScript should be nulled away in the source map. (Webpack has source map helpers for this, iirc.)

@developit
Copy link
Owner

Released in 1.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants