aurelia / bundler

A library for bundling JavaScript, HTML and CSS for use with SystemJS.
MIT License
37 stars 25 forks source link

sourceMappingURL loses a '/' when using remote location for the map files #171

Closed CedusJenkins closed 4 years ago

CedusJenkins commented 6 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior:

For non-dev environments I build the sourcemaps with a remote sourceRoot in the .js file as I want to package all the typescript files and not have them available to non-support users etc.

.pipe(gulpIf(!paths.getIsExport(), sourcemaps.write('.', {includeContent: false, 
  sourceRoot: '/src'})))
.pipe(gulpIf(paths.getIsExport(), sourcemaps.write('.', {includeContent: false, 
  sourceRoot: 'https://some-location/app-build-' + getBuildNumber() + '/src'})))

These map files get build correctly e.g. {"version":3,"sources":["../src/app.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAUI,.....blah blah blah","file":"app.js","sourceRoot":"https://some-location/app-build-123/src"}

BUT in the bundled map file that contains references to all the typescript files I get:

{"version":3,"sources":["https:/some-location/app-build-123/src/app.ts", blah blah blah.... ` NOTE only one '/' after https.

My bundle options are:

"options": { "sourceMaps": true, "inject": true, "minify": true, "depCache": true, "rev": true }

WORKAROUND: I played around with trying to escape the '/'s and \// works but I don't think it's correct/I'm not sure why. I've have expected \/\/ to work if escaping but it didn't.

Expected/desired behavior:

Lost several hours trying to debug this and play around with the escaping. Couldn't find any documentation relating to what I wanted to achieve.

(Aside - the documentation on the bundler sourcemaps is pretty much non existent.)

EisenbergEffect commented 4 years ago

Closing this issue. The aurelia-bundler library has been superseded by the aurelia-cli.