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: 'qq',
|
14 | useConfigName: 'mini',
|
15 | fn({ config }) {
|
16 | return __awaiter(this, void 0, void 0, function* () {
|
17 | const { appPath, nodeModulesPath, outputPath } = ctx.paths;
|
18 | const { npm, emptyDirectory } = ctx.helper;
|
19 | emptyDirectory(outputPath);
|
20 |
|
21 | ctx.generateProjectConfig({
|
22 | srcConfigName: 'project.qq.json',
|
23 | distConfigName: 'project.config.json'
|
24 | });
|
25 |
|
26 | const miniRunnerOpts = Object.assign({}, config, { nodeModulesPath, buildAdapter: config.platform, isBuildPlugin: false, globalObject: 'qq', fileType: {
|
27 | templ: '.qml',
|
28 | style: '.qss',
|
29 | config: '.json',
|
30 | script: '.js'
|
31 | }, isUseComponentBuildPage: true });
|
32 |
|
33 | const miniRunner = yield npm.getNpmPkg('@tarojs/mini-runner', appPath);
|
34 | yield miniRunner(appPath, miniRunnerOpts);
|
35 | });
|
36 | }
|
37 | });
|
38 | };
|