Skip to content

Commit

Permalink
Make cli override targets for sourcemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Apr 29, 2020
1 parent bb2a9e1 commit 1e9bdf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/core/core/src/PackagerRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,10 @@ export default class PackagerRunner {
};

let mapKey = cacheKeys.map;
let o = bundle.target.sourceMap ?? this.options.sourceMaps;
if (
(typeof o === 'object' ? !o.inline : o) &&
(typeof bundle.target.sourceMap === 'object'
? !bundle.target.sourceMap.inline
: bundle.target.sourceMap) &&
(await this.options.cache.blobExists(mapKey))
) {
let mapStream = this.options.cache.getStream(mapKey);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/core/src/TargetResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default class TargetResolver {
scopeHoist:
this.options.scopeHoist && descriptor.scopeHoist !== false,
}),
sourceMap: descriptor.sourceMap,
sourceMap: this.options.sourceMaps && descriptor.sourceMap,
};
});
}
Expand Down

0 comments on commit 1e9bdf6

Please sign in to comment.