Skip to content

Commit

Permalink
feat(source-maps): remove existing sourcemap links
Browse files Browse the repository at this point in the history
Some external libraries ship with sourcemaps with the dist package including a `sourcemapUrl` link. This link causes problems during bundling, and is specifically exposed by anonymous amd modules and SystemJS loader (RequireJS). This change modifies amodro to strip any existing `sourcemapURL` link from the source of a referenced library that is being bundled.

closes aurelia#659, related to aurelia#624
  • Loading branch information
simonfox committed Jun 25, 2017
1 parent cc65ec9 commit 72f8463
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/build/amodro-trace/write/packages.js
@@ -1,7 +1,8 @@
'use strict';
var defines = require('./defines'),
lang = require('../lib/lang'),
parse = require('../lib/parse');
parse = require('../lib/parse'),
removeMapFileComments = require('../../convert-source-map').removeMapFileComments;

/**
* For modules that are inside a package config, this transform will write out
Expand All @@ -27,6 +28,7 @@ function packages(options) {

contents = defines.toTransport(context, moduleName,
filePath, contents, options);
contents = removeMapFileComments(contents);

if (packageName && !hasPackageName) {
contents += ';define(\'' + packageName + '\', [\'' + moduleName +
Expand All @@ -35,7 +37,6 @@ function packages(options) {

return contents;
};

}

/**
Expand Down

0 comments on commit 72f8463

Please sign in to comment.