File tree 3 files changed +22
-2
lines changed
3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ async function _build(
156
156
respectExternal : true ,
157
157
} ,
158
158
} ,
159
+ parallel : false
159
160
} ,
160
161
) as BuildOptions ;
161
162
@@ -274,7 +275,7 @@ async function _build(
274
275
// await symlink(resolve(ctx.rootDir), nodemodulesDir).catch(() => {})
275
276
// }
276
277
277
- await Promise . all ( [
278
+ const buildTasks = [
278
279
// untyped
279
280
typesBuild ( ctx ) ,
280
281
// mkdist
@@ -283,7 +284,16 @@ async function _build(
283
284
rollupBuild ( ctx ) ,
284
285
// copy
285
286
copyBuild ( ctx ) ,
286
- ] ) ;
287
+ ] ;
288
+
289
+ // Run build tasks in parallel
290
+ if ( options . parallel ) {
291
+ await Promise . all ( buildTasks ) ;
292
+ } else {
293
+ for ( const task of buildTasks ) {
294
+ await task ;
295
+ }
296
+ }
287
297
288
298
// Skip rest for stub and watch mode
289
299
if ( options . stub || options . watch ) {
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ const main = defineCommand({
41
41
type : "boolean" ,
42
42
description : "Generate sourcemaps (experimental)" ,
43
43
} ,
44
+ parallel : {
45
+ type : "boolean" ,
46
+ description : "Run build in parallel (experimental)" ,
47
+ } ,
44
48
} ,
45
49
async run ( { args } ) {
46
50
const rootDir = resolve ( process . cwd ( ) , args . dir || "." ) ;
Original file line number Diff line number Diff line change @@ -139,6 +139,12 @@ export interface BuildOptions {
139
139
* [Rollup](https://rollupjs.org/configuration-options) Build Options
140
140
*/
141
141
rollup : RollupBuildOptions ;
142
+
143
+ /**
144
+ * @experimental
145
+ * Run build in parallel
146
+ */
147
+ parallel : boolean ;
142
148
}
143
149
144
150
export interface BuildContext {
You can’t perform that action at this time.
0 commit comments