-
Notifications
You must be signed in to change notification settings - Fork 15
Generate correct sourceMapUrl #38
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay in looking at this.
Can you please fix these minor lint errors?
Also can you please provide before and after example output for the SourceMapUrl?
@@ -13,6 +14,10 @@ export class JSBuilder { | |||
let mainModule = this._buildMainModule(data.dependencies._mainModule); | |||
let raw = data.files.js.map(path => fse.readFileSync(path).toString()).join('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path
here now causes a lint error:
ERROR: /home/travis/build/angular/material-tools/lib/builders/JSBuilder.ts[15, 33]: Shadowed name: 'path'
Can you please rename this path
variable to file
?
@@ -13,6 +14,10 @@ export class JSBuilder { | |||
let mainModule = this._buildMainModule(data.dependencies._mainModule); | |||
let raw = data.files.js.map(path => fse.readFileSync(path).toString()).join('\n'); | |||
let source = [mainModule, '', raw].join('\n'); | |||
|
|||
// Create source map filename from given minified filename | |||
filename = path.basename(filename).replace(/\.min\.js/, '.map') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is causing a lint error:
ERROR: /home/travis/build/angular/material-tools/lib/builders/JSBuilder.ts[19, 68]: Missing semicolon
Just wanted to drop a note here to remind you that there are some outstanding changes needed to this PR before we can merge it. Thank you. |
All minified files are created with an invalid
sourceMapUrl
path. I.e. instead of a relativefile.map
it uses an absolute local file path likepath/on/my/disk/to/file.min.js
.Browsers then complain about the invalid source map and actually reveal the local path in the dev console (!)