aboutsummaryrefslogtreecommitdiff
path: root/lib/minify.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-03-28 14:18:56 +0000
committerGitHub <noreply@github.com>2020-03-28 22:18:56 +0800
commit827bcec1860534442e82e9ccdfc2aca808fada5e (patch)
tree1e9b2dd08fc652a63f2709c15e17bcc3432375f6 /lib/minify.js
parentd105ab9722e7a126b149b1ddf724d0eaf4144d86 (diff)
downloadtracifyjs-827bcec1860534442e82e9ccdfc2aca808fada5e.tar.gz
tracifyjs-827bcec1860534442e82e9ccdfc2aca808fada5e.zip
handle `source-map` operations internally (#3754)
Diffstat (limited to 'lib/minify.js')
-rw-r--r--lib/minify.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/minify.js b/lib/minify.js
index 72d99576..ab397f5e 100644
--- a/lib/minify.js
+++ b/lib/minify.js
@@ -203,6 +203,7 @@ function minify(files, options) {
if (!HOP(options.output, "code") || options.output.code) {
if (options.sourceMap) {
options.output.source_map = SourceMap({
+ content: options.sourceMap.includeSources,
file: options.sourceMap.filename,
orig: source_maps,
root: options.sourceMap.root
@@ -211,10 +212,8 @@ function minify(files, options) {
if (files instanceof AST_Toplevel) {
throw new Error("original source content unavailable");
} else for (var name in files) if (HOP(files, name)) {
- options.output.source_map.get().setSourceContent(name, files[name]);
+ options.output.source_map.setSourceContent(name, files[name]);
}
- } else {
- options.output.source_map.get()._sourcesContents = null;
}
}
delete options.output.ast;