Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache babel source map. #13210

Merged
merged 1 commit into from
Apr 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions external/systemjs/plugin-babel-cached.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function getDb() {
return dbPromise;
}

function storeCache(address, hashCode, translated, format) {
function storeCache(address, hashCode, translated, format, sourceMap) {
return getDb().then(function (db) {
var tx = db.transaction(dbCacheTable, "readwrite");
var store = tx.objectStore(dbCacheTable);
Expand All @@ -53,6 +53,7 @@ function storeCache(address, hashCode, translated, format) {
translated,
expires: Date.now() + cacheExpiration,
format,
sourceMap,
});
return new Promise(function (resolve, reject) {
tx.oncomplete = function () {
Expand Down Expand Up @@ -80,6 +81,7 @@ function loadCache(address, hashCode) {
? {
translated: found.translated,
format: found.format,
sourceMap: found.sourceMap,
}
: null
);
Expand Down Expand Up @@ -127,7 +129,8 @@ exports.translate = function (load, opt) {
load.address,
savedHashCode,
translated,
load.metadata.format
load.metadata.format,
load.metadata.sourceMap
).then(function () {
return translated;
});
Expand Down