Skip to content

Commit 9245f2c

Browse files
committed
Generate original module ids for debugging purposes when bundling
1 parent 88b3b0c commit 9245f2c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

build/lib/bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function extractStrings(destFiles) {
161161
destFile.sources.forEach(function (source) {
162162
source.contents = source.contents.replace(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/, function (_, moduleMatch, depsMatch) {
163163
var defineCall = parseDefineCall(moduleMatch, depsMatch);
164-
return "define(__m[" + replacementMap[defineCall.module] + "], __M([" + defineCall.deps.map(function (dep) { return replacementMap[dep]; }).join(',') + "])";
164+
return "define(__m[" + replacementMap[defineCall.module] + "/*" + defineCall.module + "*/], __M([" + defineCall.deps.map(function (dep) { return replacementMap[dep] + '/*' + dep + '*/'; }).join(',') + "])";
165165
});
166166
});
167167
destFile.sources.unshift({

build/lib/bundle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ function extractStrings(destFiles:IConcatFile[]):IConcatFile[] {
268268
destFile.sources.forEach((source) => {
269269
source.contents = source.contents.replace(/define\(("[^"]+"),\s*\[(((, )?("|')[^"']+("|'))+)\]/, (_, moduleMatch, depsMatch) => {
270270
let defineCall = parseDefineCall(moduleMatch, depsMatch);
271-
return `define(__m[${replacementMap[defineCall.module]}], __M([${defineCall.deps.map(dep => replacementMap[dep]).join(',')}])`;
271+
return `define(__m[${replacementMap[defineCall.module]}/*${defineCall.module}*/], __M([${defineCall.deps.map(dep => replacementMap[dep] + '/*' + dep + '*/').join(',')}])`;
272272
});
273273
});
274274

0 commit comments

Comments
 (0)