(
name: string,
{
file: {es, cjs},
input = 'index',
inputExtension = 'js',
replaceVueReactivity = false,
replaceReactShim = false,
}: {
file: {es?: string; cjs: string}
input?: string
inputExtension?: string
replaceVueReactivity?: boolean
replaceReactShim?: boolean
},
)
| 548 | }) |
| 549 | } |
| 550 | async function createEsCjs( |
| 551 | name: string, |
| 552 | { |
| 553 | file: {es, cjs}, |
| 554 | input = 'index', |
| 555 | inputExtension = 'js', |
| 556 | replaceVueReactivity = false, |
| 557 | replaceReactShim = false, |
| 558 | }: { |
| 559 | file: {es?: string; cjs: string} |
| 560 | input?: string |
| 561 | inputExtension?: string |
| 562 | replaceVueReactivity?: boolean |
| 563 | replaceReactShim?: boolean |
| 564 | }, |
| 565 | ) { |
| 566 | const pluginsCjs = getPlugins(input === 'index' ? name : input, { |
| 567 | replaceVueNext: true, |
| 568 | replaceReactShim: false, |
| 569 | }) |
| 570 | const pluginListCjs = [ |
| 571 | pluginsCjs.resolve, |
| 572 | pluginsCjs.json, |
| 573 | pluginsCjs.babel, |
| 574 | pluginsCjs.terser, |
| 575 | pluginsCjs.analyzer, |
| 576 | pluginsCjs.analyzerJSON, |
| 577 | ] |
| 578 | const pluginsEsm = getPlugins(input === 'index' ? name : input, { |
| 579 | isEsm: true, |
| 580 | replaceVueReactivity, |
| 581 | replaceVueNext: true, |
| 582 | replaceReactShim, |
| 583 | }) |
| 584 | const pluginListEsm = [ |
| 585 | pluginsEsm.resolve, |
| 586 | pluginsEsm.json, |
| 587 | pluginsEsm.babel, |
| 588 | pluginsEsm.terser, |
| 589 | pluginsEsm.analyzer, |
| 590 | pluginsEsm.analyzerJSON, |
| 591 | ] |
| 592 | const [buildCjs, buildEs] = await Promise.all([ |
| 593 | rollup({ |
| 594 | onwarn, |
| 595 | input: dir(`packages/${name}/${input}.${inputExtension}`), |
| 596 | external: externals, |
| 597 | plugins: pluginListCjs, |
| 598 | }), |
| 599 | es && |
| 600 | rollup({ |
| 601 | onwarn, |
| 602 | input: dir(`packages/${name}/${input}.${inputExtension}`), |
| 603 | external: externals, |
| 604 | plugins: pluginListEsm, |
| 605 | }), |
| 606 | ]) |
| 607 | await Promise.all([ |
no test coverage detected
searching dependent graphs…