Open Jack-Works opened 9 months ago
I think this should be enabled with a separate flag or with custom loaders, e.g. some flags like --experimental-network-imports
. This would allow network access through JavaScript comments (magic source map comments) and introduce differences in application stability and security concerns.
File URL as source mapping url is already supported at the moment. Additionally, the current security model defines that user scripts on the file system are trusted so I don't think this issue is related to the requested feature.
I think this can be integrated with the flag --experimental-network-imports
because with that flag, the sources are generally loaded from the network and their source maps need to be loaded from the network as well.
Quick prototyping with a custom loader: https://github.com/legendecas/network-source-maps-loader. Ultimately, I think a new optional phase can be introduced to load source maps with V8 parsed source map magic comments to avoid regexp matching and string concatenation in the loaders.
There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the https://github.com/nodejs/node/labels/never-stale label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document.
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.
For more information on how the project manages feature requests, please consult the feature request management document.
What is the problem this feature will solve?
In some size-sensitive cases, we want to compress the output to ship smaller packages, we also want to keep useful stack traces for bug reports. Therefore I hope Node.js can resolve remote sourceMap files.
What is the feature you are proposing to solve the problem?
Resolve sourceMap at a remote URL. Here is an example (that it does not work today):
Run
node --enable-source-maps ./a.js
does not use the sourcemap.What alternatives have you considered?
No response