()
| 88 | isVerb && log(chalk.yellow('Build config:\n'), opts, '\n'); |
| 89 | |
| 90 | const buildWebpack = () => { |
| 91 | const buildConf = { |
| 92 | ...webpackConfig({ |
| 93 | production: 1, |
| 94 | args: buildWebpackArgs(opts), |
| 95 | cmdOpts: opts, |
| 96 | }), |
| 97 | ...normalizeJsonOpt(opts, 'config'), |
| 98 | }; |
| 99 | |
| 100 | if (dts === 'only') { |
| 101 | return buildDeclaration(opts); |
| 102 | } |
| 103 | |
| 104 | webpack(buildConf, async (err, stats) => { |
| 105 | const errors = err || (stats ? stats.hasErrors() : false); |
| 106 | const statConf = { |
| 107 | hash: false, |
| 108 | colors: true, |
| 109 | builtAt: false, |
| 110 | entrypoints: false, |
| 111 | modules: false, |
| 112 | ...normalizeJsonOpt(opts, 'stats'), |
| 113 | }; |
| 114 | |
| 115 | if (stats) { |
| 116 | opts.statsOutput && |
| 117 | fs.writeFileSync(rootResolve(opts.statsOutput), JSON.stringify(stats.toJson())); |
| 118 | isVerb && log(chalk.yellow('Stats config:\n'), statConf, '\n'); |
| 119 | const result = stats.toString(statConf); |
| 120 | log(result, '\n'); |
| 121 | } |
| 122 | |
| 123 | await buildLocale(opts); |
| 124 | |
| 125 | if (dts !== 'skip') { |
| 126 | await buildDeclaration(opts); |
| 127 | } |
| 128 | |
| 129 | if (errors) { |
| 130 | printError(`Error during building`); |
| 131 | console.error(err); |
| 132 | } else { |
| 133 | printRow('Building completed successfully!'); |
| 134 | } |
| 135 | }); |
| 136 | }; |
| 137 | |
| 138 | if (opts.patch) { |
| 139 | isVerb && log(chalk.yellow('Patch the version'), '\n'); |
no test coverage detected