mirror of https://github.com/status-im/metro.git
Fix source map generation with experimental caches
Summary: Fixes a typo with a property name that flow did not catch. Reviewed By: mjesun Differential Revision: D7582300 fbshipit-source-id: 039550dffb0f22ed8d2820e7fdcbe35c1d012c68
This commit is contained in:
parent
11d36cd985
commit
1c3adf5d21
|
@ -304,18 +304,22 @@ class Module {
|
||||||
// TODO: T26134860 Cache layer lives inside the transformer now; just call
|
// TODO: T26134860 Cache layer lives inside the transformer now; just call
|
||||||
// the transform method.
|
// the transform method.
|
||||||
if (this._experimentalCaches) {
|
if (this._experimentalCaches) {
|
||||||
// Source code is read on the worker.
|
const result: TransformedCode = await this._transformCode(
|
||||||
const data = {
|
this,
|
||||||
...(await this._transformCode(this, null, transformOptions)),
|
null, // Source code is read on the worker
|
||||||
|
transformOptions,
|
||||||
|
);
|
||||||
|
|
||||||
|
const module = this;
|
||||||
|
|
||||||
|
return {
|
||||||
|
code: result.code,
|
||||||
|
dependencies: result.dependencies,
|
||||||
|
map: result.map,
|
||||||
|
get source() {
|
||||||
|
return module._readSourceCode();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line lint/flow-no-fixme
|
|
||||||
// $FlowFixMe: Flow wants "value" here, where the get is for AVOIDING it.
|
|
||||||
Object.defineProperty(data, 'sourceCode', {
|
|
||||||
get: () => this._readSourceCode.bind(this),
|
|
||||||
});
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const cached = this.readCached(transformOptions);
|
const cached = this.readCached(transformOptions);
|
||||||
|
|
Loading…
Reference in New Issue