Skip to content

Commit

Permalink
build: 更新打包配置 🦚🦚
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyh2001 committed Aug 8, 2022
1 parent 1d2d496 commit 600f3dd
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 43 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"@fighting-design/fighting-components": "workspace:*",
"@fighting-design/fighting-theme": "workspace:*",
"@vitejs/plugin-vue": "^2.3.1",
"@vue/runtime-core": "^3.2.37",
"@vue/test-utils": "^2.0.0-rc.18",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "^3.3.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/fighting-components/_interface/button.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { buttonType } from '../button/src/interface'

export interface RipplesInterface {
evt: buttonEventInterface
node: HTMLElement
Expand Down
2 changes: 2 additions & 0 deletions packages/fighting-components/_interface/image.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { imageFit } from '../image/src/interface'

export interface LazyInterface {
observer(): IntersectionObserver
lazyCreateImg(): void
Expand Down
2 changes: 1 addition & 1 deletion packages/fighting-components/_interface/watermark.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface createBase64Interface {
(
content = '',
content: string,
width: number,
height: number,
fontSize: string,
Expand Down
4 changes: 1 addition & 3 deletions packages/fighting-components/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import '@vue/runtime-core'

declare module '@vue/runtime-core' {
declare module 'vue' {
export interface GlobalComponents {
FButton: typeof import('./button/src/button.vue')['default']
FButtonGroup: typeof import('./button-group/src/button-group.vue')['default']
Expand Down
1 change: 1 addition & 0 deletions packages/fighting-components/message/src/interface.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Props } from './message'
import type { ExtractPropTypes, ComponentInternalInstance } from 'vue'

export interface FMessageInstance {
Expand Down
2 changes: 0 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions start/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { createApp } from 'vue'
import App from './src/App.vue'

// 开发阶段引入
import FightingDesign from '@fighting-design/fighting-components'
// import FightingDesign from '@fighting-design/fighting-components'
import '@fighting-design/fighting-theme'

// 打包阶段引入
// import FightingDesign from '../dist'
import FightingDesign from '../dist'
// import '../dist/dist/style.css'

console.log(FightingDesign)
Expand Down
23 changes: 9 additions & 14 deletions vite.config.lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,20 @@ export default (): UserConfigExport => {
rollupOptions: {
external: ['vue'],
input,
output: [
{
format: 'cjs',
dir: 'dist/lib',
entryFileNames: '[name].js',
preserveModules: true,
preserveModulesRoot: 'components'
output: {
format: 'cjs',
dir: 'dist/lib',
entryFileNames: '[name].js',
preserveModules: true,
preserveModulesRoot: 'components',
globals: {
vue: 'Vue'
}
]
}
},
lib: {
entry: input,
formats: ['cjs']
},
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
}
},
plugins: [
Expand Down
23 changes: 9 additions & 14 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,20 @@ export default (): UserConfigExport => {
rollupOptions: {
external: ['vue'], // 忽略打包vue文件
input,
output: [
{
format: 'es',
dir: 'dist/es',
entryFileNames: '[name].js',
preserveModules: true, // 让打包目录和我们目录对应
preserveModulesRoot: 'components' // 配置打包根目录
output: {
format: 'es',
dir: 'dist/es',
entryFileNames: '[name].js',
preserveModules: true, // 让打包目录和我们目录对应
preserveModulesRoot: 'components', // 配置打包根目录
globals: {
vue: 'Vue'
}
]
}
},
lib: {
entry: input,
formats: ['es']
},
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
}
},
plugins: [
Expand Down
6 changes: 0 additions & 6 deletions vite.config.umd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ export default (): UserConfigExport => {
vue: 'Vue'
}
}
},
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
}
}
}
Expand Down

0 comments on commit 600f3dd

Please sign in to comment.