Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Generate correct sourceMapUrl #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexthewilde
Copy link

@alexthewilde alexthewilde commented Feb 6, 2019

All minified files are created with an invalid sourceMapUrl path. I.e. instead of a relative file.map it uses an absolute local file path like path/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 (!)

Copy link
Member

@Splaktar Splaktar left a 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');
Copy link
Member

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')
Copy link
Member

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

@Splaktar
Copy link
Member

Splaktar commented Jan 9, 2020

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.

@Splaktar Splaktar modified the milestones: 1.0.0, Backlog, 1.0.1 Oct 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants