diff --git a/lib/build/bundle.js b/lib/build/bundle.js index 065e9df59..f2e5e18d6 100644 --- a/lib/build/bundle.js +++ b/lib/build/bundle.js @@ -136,7 +136,18 @@ exports.Bundle = class { }); } - work = work.then(() => files = files.concat(this.getBundledFiles())); + // Sort files by path to be sure they will alway be concatenated in the same order. + let bundleFiles = this.getBundledFiles() + .sort((a, b) => { + if (a.path > b.path) { + return -1 + } else if (b.path > a.path) { + return 1 + } else { + return 0 + } + }); + work = work.then(() => files = files.concat(bundleFiles)); if (this.append.length) { work = work.then(() => addFilesInOrder(this, this.append, files)); @@ -211,7 +222,6 @@ exports.Bundle = class { content = Convert.removeMapFileComments(currentFile.contents); } } - concat.add(currentFile.path, content, sourceMap ? JSON.stringify(sourceMap) : undefined); }