1 | "use strict";
|
2 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3 | return new (P || (P = Promise))(function (resolve, reject) {
|
4 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6 | function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
7 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8 | });
|
9 | };
|
10 | Object.defineProperty(exports, "__esModule", { value: true });
|
11 | exports.default = (ctx) => {
|
12 | ctx.registerPlatform({
|
13 | name: 'rn',
|
14 | useConfigName: 'rn',
|
15 | fn({ config }) {
|
16 | return __awaiter(this, void 0, void 0, function* () {
|
17 | const { appPath, outputPath } = ctx.paths;
|
18 | const { isWatch, port } = ctx.runOpts;
|
19 | const { emptyDirectory } = ctx.helper;
|
20 | const { modifyWebpackChain, modifyBuildAssets, onBuildFinish } = config;
|
21 | emptyDirectory(outputPath);
|
22 | require('../../rn').build(appPath, {
|
23 | watch: isWatch,
|
24 | port
|
25 | }, {
|
26 | modifyWebpackChain,
|
27 | modifyBuildAssets,
|
28 | onBuildFinish
|
29 | });
|
30 | });
|
31 | }
|
32 | });
|
33 | };
|