mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix #2627 (source maps with a PATH_PREFIX)
When you set ROOT_URL_PATH_PREFIX, source maps are not found because the server serves them at a different path from where the client looks for them. I don’t understand this code super well, but based on what’s reported in issue #2627, the new code seems strictly more correct than the old code.
This commit is contained in:
@@ -424,8 +424,11 @@ WebAppInternals.staticFilesMiddleware = function (staticFiles, req, res, next) {
|
||||
//
|
||||
// You may also need to enable source maps in Chrome: open dev tools, click
|
||||
// the gear in the bottom right corner, and select "enable source maps".
|
||||
if (info.sourceMapUrl)
|
||||
res.setHeader('X-SourceMap', info.sourceMapUrl);
|
||||
if (info.sourceMapUrl) {
|
||||
res.setHeader('X-SourceMap',
|
||||
__meteor_runtime_config__.ROOT_URL_PATH_PREFIX +
|
||||
info.sourceMapUrl);
|
||||
}
|
||||
|
||||
if (info.type === "js") {
|
||||
res.setHeader("Content-Type", "application/javascript; charset=UTF-8");
|
||||
|
||||
Reference in New Issue
Block a user