1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | function build(kernel, { platform, isWatch, release, port, env, ui, uiIndex, page, component, envHasBeenSet = false, plugin, isHelp }) {
|
4 | if (plugin) {
|
5 | if (typeof plugin === 'boolean') {
|
6 | plugin = 'weapp';
|
7 | }
|
8 | platform = 'plugin';
|
9 | }
|
10 | if (platform === 'plugin') {
|
11 | plugin = plugin || 'weapp';
|
12 | }
|
13 | if (ui) {
|
14 | platform = 'ui';
|
15 | }
|
16 | let nodeEnv = process.env.NODE_ENV || env;
|
17 | if (!nodeEnv) {
|
18 | if (isWatch) {
|
19 | nodeEnv = 'development';
|
20 | }
|
21 | else {
|
22 | nodeEnv = 'production';
|
23 | }
|
24 | }
|
25 | process.env.NODE_ENV = nodeEnv;
|
26 | process.env.TARO_ENV = platform;
|
27 | kernel.run({
|
28 | name: 'build',
|
29 | opts: {
|
30 | platform,
|
31 | isWatch,
|
32 | release,
|
33 | port,
|
34 | ui,
|
35 | uiIndex,
|
36 | page,
|
37 | component,
|
38 | envHasBeenSet,
|
39 | plugin,
|
40 | isHelp
|
41 | }
|
42 | });
|
43 | }
|
44 | exports.default = build;
|
45 |
|
\ | No newline at end of file |