Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
saqqdy committed Jun 12, 2022
2 parents d01b6b1 + 3d85fdc commit 91fe854
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 35 deletions.
1 change: 1 addition & 0 deletions build/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ export { default as json } from './json'
export { default as cssOnly } from './cssOnly'
export { default as commonjs } from './commonjs'
export { default as filesize } from './filesize'
export { default as noop } from './noop'
12 changes: 12 additions & 0 deletions build/plugins/noop.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Plugin } from 'rollup'

function noop() {
return {
name: 'noop',
renderChunk(code: string) {
return { code }
}
}
}

export default noop() as Plugin
59 changes: 24 additions & 35 deletions build/tasks/buildLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,45 +182,34 @@ export async function buildLib() {
...external
])
}

// dts
if (dts !== false) {
rollupConfig.plugins.push(nodeExternals(), dtsPlugin)
writeOptions.push({
file: resolve(
PACKAGE,
name,
'lib',
fn.replace(/\.ts$/, '.d.ts')
),
format: 'es'
})
// const rollupDtsConfig = {
// input,
// plugins: [nodeExternals(), dtsPlugin],
// external: [...externals, ...external]
// }
// const writeDtsOptions: OutputOptions[] = [
// {
// file: resolve(
// PACKAGE,
// name,
// 'lib',
// fn.replace(/\.ts$/, '.d.ts')
// ),
// format: 'es'
// }
// ]
// const dtsBundle = await rollup(rollupDtsConfig)
// await Promise.all([
// writeDtsOptions.map(option => dtsBundle.write(option))
// ])
}

const bundle = await rollup(rollupConfig)
await Promise.all(
writeOptions.map(option => bundle.write(option))
)

// dts
if (dts !== false) {
const rollupDtsConfig = {
input,
plugins: [nodeExternals(), dtsPlugin],
external: [...externals, ...external]
}
const writeDtsOptions: OutputOptions[] = [
{
file: resolve(
PACKAGE,
name,
'lib',
fn.replace(/\.ts$/, '.d.ts')
),
format: 'es'
}
]
const dtsBundle = await rollup(rollupDtsConfig)
await Promise.all([
writeDtsOptions.map(option => dtsBundle.write(option))
])
}
}
}
)
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ declare module '@vue/runtime-core' {
export interface GlobalComponents {
Box: typeof import('./src/components/box/index.vue')['default']
Button: typeof import('./src/components/button/index.vue')['default']
Cell: typeof import('./src/components/cell_bak/cell.vue')['default']
Checkbox_bak: typeof import('./src/components/checkbox_bak/index.vue')['default']
Collapse: typeof import('./src/components/collapse/index.vue')['default']
CollapseItem: typeof import('./src/components/collapse-item/index.vue')['default']
ElButton: typeof import('element-plus/es')['ElButton']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElInput: typeof import('element-plus/es')['ElInput']
ElOption: typeof import('element-plus/es')['ElOption']
ElSelect: typeof import('element-plus/es')['ElSelect']
Group: typeof import('./src/components/group_bak/group.vue')['default']
Nav: typeof import('./src/components/nav.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Expand Down

0 comments on commit 91fe854

Please sign in to comment.