@tarojs/rn-runner 3.3.12 → 3.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
var __values = (this && this.__values) || function(o) {
|
|
3
39
|
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
40
|
if (m) return m.call(o);
|
|
@@ -20,6 +56,8 @@ var ConditionalFileStore = /** @class */ (function () {
|
|
|
20
56
|
}
|
|
21
57
|
ConditionalFileStore.prototype.isEntryCache = function (cacheItem) {
|
|
22
58
|
var e_1, _a;
|
|
59
|
+
if (!cacheItem)
|
|
60
|
+
return false;
|
|
23
61
|
var dependencies = cacheItem.dependencies;
|
|
24
62
|
if (!dependencies || !dependencies.length) {
|
|
25
63
|
return false;
|
|
@@ -42,19 +80,36 @@ var ConditionalFileStore = /** @class */ (function () {
|
|
|
42
80
|
return false;
|
|
43
81
|
};
|
|
44
82
|
ConditionalFileStore.prototype.get = function (key) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
83
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
+
var result;
|
|
85
|
+
return __generator(this, function (_a) {
|
|
86
|
+
switch (_a.label) {
|
|
87
|
+
case 0: return [4 /*yield*/, this._fileStore.get(key)];
|
|
88
|
+
case 1:
|
|
89
|
+
result = _a.sent();
|
|
90
|
+
if (result && this.ignoreEntryFileCache && this.isEntryCache(result)) {
|
|
91
|
+
return [2 /*return*/, null];
|
|
92
|
+
}
|
|
93
|
+
return [2 /*return*/, result];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
50
97
|
};
|
|
51
98
|
ConditionalFileStore.prototype.set = function (key, value) {
|
|
52
99
|
var _a, _b, _c, _d, _e;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
100
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
101
|
+
return __generator(this, function (_f) {
|
|
102
|
+
switch (_f.label) {
|
|
103
|
+
case 0:
|
|
104
|
+
// fix: 样式文件不写缓存
|
|
105
|
+
if (((_e = (_d = (_c = (_b = (_a = value === null || value === void 0 ? void 0 : value.output) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.functionMap) === null || _d === void 0 ? void 0 : _d.names) === null || _e === void 0 ? void 0 : _e.indexOf('ignoreStyleFileCache')) > -1) {
|
|
106
|
+
return [2 /*return*/];
|
|
107
|
+
}
|
|
108
|
+
return [4 /*yield*/, this._fileStore.set(key, value)];
|
|
109
|
+
case 1: return [2 /*return*/, _f.sent()];
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
});
|
|
58
113
|
};
|
|
59
114
|
ConditionalFileStore.prototype.clear = function () {
|
|
60
115
|
this._fileStore.clear();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional-file-store.js","sourceRoot":"","sources":["../../src/config/conditional-file-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"conditional-file-store.js","sourceRoot":"","sources":["../../src/config/conditional-file-store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAO,CAAC,sBAAsB,CAAC,IAAG,CAAC,CAAC,EAAE;4BACtF,sBAAM;yBACP;wBACM,qBAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,EAAA;4BAA5C,sBAAO,SAAqC,EAAA;;;;KAC7C;IAED,oCAAK,GAAL;QACE,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;IACzB,CAAC;IACH,2BAAC;AAAD,CAAC,AA5CD,IA4CC"}
|
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ var Server = require("metro/src/Server");
|
|
|
64
64
|
var saveAssets_1 = require("@react-native-community/cli/build/commands/bundle/saveAssets");
|
|
65
65
|
var outputBundle = require("metro/src/shared/output/bundle");
|
|
66
66
|
function concatOutputFileName(config) {
|
|
67
|
+
// 优先级:--bundle-output > config.output > config.outputRoot
|
|
67
68
|
var output = path.join(config.outputRoot, 'index.bundle');
|
|
68
69
|
if (config.output) {
|
|
69
70
|
var outputType = typeof config.output;
|
|
@@ -80,15 +81,25 @@ function concatOutputFileName(config) {
|
|
|
80
81
|
console.error("invalid value for 'rn.output' configuration: " + JSON.stringify(config.output));
|
|
81
82
|
}
|
|
82
83
|
}
|
|
84
|
+
if (config.bundleOutput) {
|
|
85
|
+
output = config.bundleOutput;
|
|
86
|
+
}
|
|
83
87
|
var res = path.isAbsolute(output) ? output : path.join('.', output);
|
|
84
88
|
fse.ensureDirSync(path.dirname(res));
|
|
85
89
|
return res;
|
|
86
90
|
}
|
|
87
91
|
function concatOutputAssetsDest(config) {
|
|
92
|
+
// 优先级:--assets-dest > config.output > config.outputRoot
|
|
93
|
+
var assetDest;
|
|
88
94
|
if (!(config === null || config === void 0 ? void 0 : config.deviceType) || !(config === null || config === void 0 ? void 0 : config.output)) {
|
|
89
|
-
|
|
95
|
+
assetDest = config.outputRoot;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
assetDest = config.deviceType === 'ios' ? config.output.iosAssetsDest : config.output.androidAssetsDest;
|
|
99
|
+
}
|
|
100
|
+
if (config.assetsDest) {
|
|
101
|
+
assetDest = config.assetsDest;
|
|
90
102
|
}
|
|
91
|
-
var assetDest = config.deviceType === 'ios' ? config.output.iosAssetsDest : config.output.androidAssetsDest;
|
|
92
103
|
if (!assetDest)
|
|
93
104
|
return undefined;
|
|
94
105
|
var res = path.isAbsolute(assetDest) ? assetDest : path.join('.', assetDest);
|
|
@@ -96,25 +107,20 @@ function concatOutputAssetsDest(config) {
|
|
|
96
107
|
return res;
|
|
97
108
|
}
|
|
98
109
|
function getOutputSourceMapOption(config) {
|
|
99
|
-
|
|
110
|
+
var _a, _b, _c, _d, _e, _f;
|
|
111
|
+
if (!(config === null || config === void 0 ? void 0 : config.deviceType)) {
|
|
100
112
|
return {};
|
|
101
113
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return {
|
|
113
|
-
sourceMapUrl: config.output.androidSourceMapUrl,
|
|
114
|
-
sourcemapOutput: config.output.androidSourcemapOutput,
|
|
115
|
-
sourcemapSourcesRoot: config.output.androidSourcemapSourcesRoot
|
|
116
|
-
};
|
|
117
|
-
}
|
|
114
|
+
var isIos = config.deviceType === 'ios';
|
|
115
|
+
var sourceMapUrl = config.sourceMapUrl || (isIos ? (_a = config === null || config === void 0 ? void 0 : config.output) === null || _a === void 0 ? void 0 : _a.iosSourceMapUrl : (_b = config === null || config === void 0 ? void 0 : config.output) === null || _b === void 0 ? void 0 : _b.androidSourceMapUrl);
|
|
116
|
+
var sourcemapOutput = config.sourcemapOutput || (isIos ? (_c = config === null || config === void 0 ? void 0 : config.output) === null || _c === void 0 ? void 0 : _c.iosSourcemapOutput : (_d = config === null || config === void 0 ? void 0 : config.output) === null || _d === void 0 ? void 0 : _d.androidSourcemapOutput);
|
|
117
|
+
var sourcemapSourcesRoot = config.sourcemapSourcesRoot || (isIos ? (_e = config === null || config === void 0 ? void 0 : config.output) === null || _e === void 0 ? void 0 : _e.iosSourcemapSourcesRoot : (_f = config === null || config === void 0 ? void 0 : config.output) === null || _f === void 0 ? void 0 : _f.androidSourcemapSourcesRoot);
|
|
118
|
+
sourcemapOutput && fse.ensureDirSync(path.dirname(sourcemapOutput));
|
|
119
|
+
return {
|
|
120
|
+
sourceMapUrl: sourceMapUrl,
|
|
121
|
+
sourcemapOutput: sourcemapOutput,
|
|
122
|
+
sourcemapSourcesRoot: sourcemapSourcesRoot
|
|
123
|
+
};
|
|
118
124
|
}
|
|
119
125
|
function getOpenHost() {
|
|
120
126
|
var _a;
|
|
@@ -161,6 +167,9 @@ function build(appPath, config) {
|
|
|
161
167
|
if (config.resetCache) {
|
|
162
168
|
metroConfig.resetCache = config.resetCache;
|
|
163
169
|
}
|
|
170
|
+
if (config.publicPath) {
|
|
171
|
+
metroConfig.transformer.publicPath = config.publicPath;
|
|
172
|
+
}
|
|
164
173
|
metroConfig.reporter = new terminal_reporter_1.TerminalReporter(entry, sourceRoot, metroConfig.cacheStores[0]);
|
|
165
174
|
onFinish = function (error) {
|
|
166
175
|
if (typeof config.onBuildFinish === 'function') {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA8B;AAC9B,mCAAqC;AACrC,wDAAyD;AAEzD,yCAA0C;AAC1C,2BAA4B;AAC5B,8BAA+B;AAC/B,yBAA0B;AAC1B,yBAAsC;AACtC,mDAA0C;AAE1C,mCAAoC;AACpC,yEAAkF;AAClF,gEAA6D;AAC7D,mEAAuE;AACvE,yCAA0C;AAC1C,2FAAqF;AACrF,6DAA8D;AAE9D,SAAS,oBAAoB,CAAE,MAAW;IACxC,IAAI,MAAM,GAAG,IAAI,C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D,cAAc,kCACf,aAAa,GACb,eAAe,KAClB,SAAS,EAAE,OAAO,CAAC,KAAK,EACxB,eAAe,EAAE,KAAK,EACtB,qBAAqB,EAAE,WAAW,CAAC,UAAU,CAAC,qBAAqB,GACpE,CAAA;oBACc,qBAAM,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,EAAA;;oBAAzD,MAAM,GAAG,SAAgD;oBACzD,aAAa,kCACd,aAAa,GACb,eAAe,KAClB,YAAY,EAAE,OAAO,CAAC,GAAG,GAC1B,CAAA;oBACD,qBAAM,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC;wBAE3D,gCAAgC;sBAF2B;;oBAA3D,SAA2D,CAAA;oBAGtC,qBAAM,MAAM,CAAC,SAAS,uBACtC,MAAM,CAAC,sBAAsB,GAC7B,cAAc,EACjB,EAAA;;oBAHI,YAAY,GAAG,SAGnB;oBACK,qBAAM,oBAAU,CAAC,YAAY,EAAE,OAAO,CAAC,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;4BAC3F,QAAQ,CAAC,IAAI,CAAC,CAAA;wBAChB,CAAC,CAAC,EAAA;wBAFF,sBAAO,SAEL,EAAA;;;oBAEF,QAAQ,CAAC,GAAC,CAAC,CAAA;;;oBAEX,MAAM,CAAC,GAAG,EAAE,CAAA;;;;;;CAGjB;AAvJD,wBAuJC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/rn-runner",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.16",
|
|
4
4
|
"description": "ReactNative build tool for taro",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@react-native-community/cli": "^5.0.1",
|
|
34
34
|
"@react-native-community/cli-server-api": "^5.0.1",
|
|
35
|
-
"@tarojs/helper": "3.3.
|
|
36
|
-
"@tarojs/rn-style-transformer": "3.3.
|
|
37
|
-
"@tarojs/rn-supporter": "3.3.
|
|
38
|
-
"@tarojs/rn-transformer": "3.3.
|
|
35
|
+
"@tarojs/helper": "3.3.16",
|
|
36
|
+
"@tarojs/rn-style-transformer": "3.3.16",
|
|
37
|
+
"@tarojs/rn-supporter": "3.3.16",
|
|
38
|
+
"@tarojs/rn-transformer": "3.3.16",
|
|
39
39
|
"fs-extra": "^9.0.1",
|
|
40
40
|
"lodash": "^4.17.4",
|
|
41
41
|
"metro": "^0.66.2",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"metro-resolver": "^0.66.2",
|
|
47
47
|
"qrcode-terminal": "^0.12.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "75d3de695c98fab79998612ef87567a68ea981a7"
|
|
50
50
|
}
|
|
@@ -11,6 +11,7 @@ export default class ConditionalFileStore<T> {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
isEntryCache (cacheItem): boolean {
|
|
14
|
+
if (!cacheItem) return false
|
|
14
15
|
const { dependencies } = cacheItem
|
|
15
16
|
if (!dependencies || !dependencies.length) {
|
|
16
17
|
return false
|
|
@@ -24,20 +25,20 @@ export default class ConditionalFileStore<T> {
|
|
|
24
25
|
return false
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
get (key: Buffer): T | null {
|
|
28
|
-
const result = this._fileStore.get(key)
|
|
28
|
+
async get (key: Buffer): Promise<T | null> {
|
|
29
|
+
const result = await this._fileStore.get(key)
|
|
29
30
|
if (result && this.ignoreEntryFileCache && this.isEntryCache(result)) {
|
|
30
31
|
return null
|
|
31
32
|
}
|
|
32
33
|
return result
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
set (key: Buffer, value: any): void {
|
|
36
|
+
async set (key: Buffer, value: any): Promise<void> {
|
|
36
37
|
// fix: 样式文件不写缓存
|
|
37
38
|
if (value?.output?.[0]?.data?.functionMap?.names?.indexOf('ignoreStyleFileCache') > -1) {
|
|
38
39
|
return
|
|
39
40
|
}
|
|
40
|
-
this._fileStore.set(key, value)
|
|
41
|
+
return await this._fileStore.set(key, value)
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
clear (): void {
|
package/src/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ import saveAssets from '@react-native-community/cli/build/commands/bundle/saveAs
|
|
|
18
18
|
import * as outputBundle from 'metro/src/shared/output/bundle'
|
|
19
19
|
|
|
20
20
|
function concatOutputFileName (config: any): string {
|
|
21
|
+
// 优先级:--bundle-output > config.output > config.outputRoot
|
|
21
22
|
let output = path.join(config.outputRoot, 'index.bundle')
|
|
22
23
|
if (config.output) {
|
|
23
24
|
const outputType = typeof config.output
|
|
@@ -32,16 +33,25 @@ function concatOutputFileName (config: any): string {
|
|
|
32
33
|
console.error(`invalid value for 'rn.output' configuration: ${JSON.stringify(config.output)}`)
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
if (config.bundleOutput) {
|
|
37
|
+
output = config.bundleOutput
|
|
38
|
+
}
|
|
35
39
|
const res = path.isAbsolute(output) ? output : path.join('.', output)
|
|
36
40
|
fse.ensureDirSync(path.dirname(res))
|
|
37
41
|
return res
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
function concatOutputAssetsDest (config: any): string | undefined {
|
|
45
|
+
// 优先级:--assets-dest > config.output > config.outputRoot
|
|
46
|
+
let assetDest
|
|
41
47
|
if (!config?.deviceType || !config?.output) {
|
|
42
|
-
|
|
48
|
+
assetDest = config.outputRoot
|
|
49
|
+
} else {
|
|
50
|
+
assetDest = config.deviceType === 'ios' ? config.output.iosAssetsDest : config.output.androidAssetsDest
|
|
51
|
+
}
|
|
52
|
+
if (config.assetsDest) {
|
|
53
|
+
assetDest = config.assetsDest
|
|
43
54
|
}
|
|
44
|
-
const assetDest = config.deviceType === 'ios' ? config.output.iosAssetsDest : config.output.androidAssetsDest
|
|
45
55
|
if (!assetDest) return undefined
|
|
46
56
|
const res = path.isAbsolute(assetDest) ? assetDest : path.join('.', assetDest)
|
|
47
57
|
fse.ensureDirSync(path.dirname(res))
|
|
@@ -49,23 +59,18 @@ function concatOutputAssetsDest (config: any): string | undefined {
|
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
function getOutputSourceMapOption (config: any): Record<string, any> {
|
|
52
|
-
if (!config?.deviceType
|
|
62
|
+
if (!config?.deviceType) {
|
|
53
63
|
return {}
|
|
54
64
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
sourceMapUrl: config.output.androidSourceMapUrl,
|
|
66
|
-
sourcemapOutput: config.output.androidSourcemapOutput,
|
|
67
|
-
sourcemapSourcesRoot: config.output.androidSourcemapSourcesRoot
|
|
68
|
-
}
|
|
65
|
+
const isIos = config.deviceType === 'ios'
|
|
66
|
+
const sourceMapUrl = config.sourceMapUrl || (isIos ? config?.output?.iosSourceMapUrl : config?.output?.androidSourceMapUrl)
|
|
67
|
+
const sourcemapOutput = config.sourcemapOutput || (isIos ? config?.output?.iosSourcemapOutput : config?.output?.androidSourcemapOutput)
|
|
68
|
+
const sourcemapSourcesRoot = config.sourcemapSourcesRoot || (isIos ? config?.output?.iosSourcemapSourcesRoot : config?.output?.androidSourcemapSourcesRoot)
|
|
69
|
+
sourcemapOutput && fse.ensureDirSync(path.dirname(sourcemapOutput))
|
|
70
|
+
return {
|
|
71
|
+
sourceMapUrl,
|
|
72
|
+
sourcemapOutput,
|
|
73
|
+
sourcemapSourcesRoot
|
|
69
74
|
}
|
|
70
75
|
}
|
|
71
76
|
|
|
@@ -108,6 +113,9 @@ export default async function build (appPath: string, config: any): Promise<any>
|
|
|
108
113
|
if (config.resetCache) {
|
|
109
114
|
metroConfig.resetCache = config.resetCache
|
|
110
115
|
}
|
|
116
|
+
if (config.publicPath) {
|
|
117
|
+
metroConfig.transformer.publicPath = config.publicPath
|
|
118
|
+
}
|
|
111
119
|
metroConfig.reporter = new TerminalReporter(entry, sourceRoot, metroConfig.cacheStores[0])
|
|
112
120
|
|
|
113
121
|
const onFinish = function (error?) {
|