Skip to content

Commit

Permalink
make the cache check more robust. always check for sourcemap in manif…
Browse files Browse the repository at this point in the history
…est too (#101)
  • Loading branch information
matt-gadd authored Dec 13, 2018
1 parent a4ac7c9 commit 65ad68f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/build-time-render/BuildTimeRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default class BuildTimeRender {
private _writeBuildBridgeCache() {
Object.keys(this._manifestContent).forEach((chunkname) => {
let modified = false;
if (/\.js$/.test(chunkname)) {
if (/\.js$/.test(chunkname) && this._manifestContent[`${chunkname}.map`]) {
const content = this._manifestContent[chunkname];
const sourceMap = this._manifestContent[`${chunkname}.map`];
const node = SourceNode.fromStringWithSourceMap(content, new SourceMapConsumer(sourceMap));
Expand Down
9 changes: 8 additions & 1 deletion src/build-time-render/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ export default function () {
return global.__dojoBuildBridge(modulePath, args);
}
else {
return global.__dojoBuildBridgeCache[modulePath][JSON.stringify(args)];
var stringifiedArgs = JSON.stringify(args);
if (global__dojoBuildBridgeCache &&
global.__dojoBuildBridgeCache[modulePath] &&
global.__dojoBuildBridgeCache[modulePath][stringifiedArgs]
) {
return global.__dojoBuildBridgeCache[modulePath][stringifiedArgs];
}
return undefined;
}
}

0 comments on commit 65ad68f

Please sign in to comment.