@sparknest/ui-build-vue 1.4.4 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.mjs +14 -6
package/package.json
CHANGED
package/src/index.mjs
CHANGED
|
@@ -431,11 +431,11 @@ async function assertOutputs(config) {
|
|
|
431
431
|
const root = resolve(config.root)
|
|
432
432
|
const required = [
|
|
433
433
|
'es/index.mjs',
|
|
434
|
-
`es/${config.bundleName}.esm.js`,
|
|
435
434
|
`es/${config.bundleName}.css`,
|
|
436
|
-
`lib/${config.bundleName}.cjs.js`,
|
|
437
|
-
`umd/${config.bundleName}.js`,
|
|
438
435
|
]
|
|
436
|
+
if (config.bundleFormats.includes('es')) required.push(`es/${config.bundleName}.esm.js`)
|
|
437
|
+
if (config.bundleFormats.includes('cjs')) required.push(`lib/${config.bundleName}.cjs.js`)
|
|
438
|
+
if (config.bundleFormats.includes('umd')) required.push(`umd/${config.bundleName}.js`)
|
|
439
439
|
if (config.emitTypes !== false) {
|
|
440
440
|
required.push('types/index.d.ts')
|
|
441
441
|
}
|
|
@@ -468,6 +468,8 @@ export async function buildLibrary(userConfig) {
|
|
|
468
468
|
tsconfig: 'tsconfig.build.json',
|
|
469
469
|
emitTypes: true,
|
|
470
470
|
vueSfcStyles: false,
|
|
471
|
+
// Whole-library JS bundle formats. Defaults to ['es', 'cjs', 'umd'].
|
|
472
|
+
bundleFormats: ['es', 'cjs', 'umd'],
|
|
471
473
|
// Optional. When missing, full `{bundleName}.css` is auto-aggregated from **/style/index.less.
|
|
472
474
|
fullCssEntry: 'index.less',
|
|
473
475
|
...userConfig,
|
|
@@ -488,9 +490,15 @@ export async function buildLibrary(userConfig) {
|
|
|
488
490
|
await buildModules(config, entries, 'es', 'es', 'mjs')
|
|
489
491
|
await buildModules(config, entries, 'cjs', 'lib', 'js')
|
|
490
492
|
await assertNoBundlerHelpers(config)
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
493
|
+
if (config.bundleFormats.includes('es')) {
|
|
494
|
+
await buildBundle(config, 'es', 'es', `${config.bundleName}.esm.js`)
|
|
495
|
+
}
|
|
496
|
+
if (config.bundleFormats.includes('cjs')) {
|
|
497
|
+
await buildBundle(config, 'cjs', 'lib', `${config.bundleName}.cjs.js`)
|
|
498
|
+
}
|
|
499
|
+
if (config.bundleFormats.includes('umd')) {
|
|
500
|
+
await buildBundle(config, 'umd', 'umd', `${config.bundleName}.js`)
|
|
501
|
+
}
|
|
494
502
|
await compileStyles({ ...config, outputs: ['es', 'lib', 'umd'] })
|
|
495
503
|
if (config.emitTypes !== false) {
|
|
496
504
|
await run('tsc', ['--runExternalCode', '-p', config.tsconfig], config.root)
|