File tree Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Expand file tree Collapse file tree 3 files changed +25
-8
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-expression-editor" ,
3
- "version" : " 1.0.4 " ,
3
+ "version" : " 1.0.5 " ,
4
4
"description" : " A powerful Vue 3 mathematical expression editor component" ,
5
5
"main" : " dist/index.js" ,
6
6
"module" : " dist/index.mjs" ,
7
7
"types" : " dist/types/index.d.ts" ,
8
8
"style" : " dist/index.css" ,
9
+ "exports" : {
10
+ "." : {
11
+ "types" : " ./dist/types/index.d.ts" ,
12
+ "import" : " ./dist/index.mjs" ,
13
+ "require" : " ./dist/index.js"
14
+ },
15
+ "./dist/index.css" : {
16
+ "import" : " ./dist/index.css" ,
17
+ "require" : " ./dist/index.css"
18
+ }
19
+ },
9
20
"files" : [
10
21
" dist" ,
11
22
" README.md" ,
Original file line number Diff line number Diff line change 1
1
import { App } from 'vue'
2
2
import ExpressionEditor from './components/ExpressionEditor.vue'
3
- // 引入基础样式
3
+
4
+ // 确保样式依赖被正确加载,注意引入顺序
5
+ import './components/styles/variables.scss'
4
6
import './components/styles/base.scss'
5
7
import './components/styles/buttons.scss'
6
8
import './components/styles/input.scss'
7
9
import './components/styles/layout.scss'
8
10
import './components/styles/theme.scss'
9
11
12
+ // 添加组件类型声明
13
+ declare module 'vue' {
14
+ export interface GlobalComponents {
15
+ ExpressionEditor : typeof ExpressionEditor
16
+ }
17
+ }
18
+
10
19
const install = ( app : App ) => {
11
20
app . component ( 'ExpressionEditor' , ExpressionEditor )
12
21
}
13
22
14
- // 直接导出组件
15
23
ExpressionEditor . install = install
16
24
17
25
export { ExpressionEditor }
Original file line number Diff line number Diff line change @@ -12,11 +12,12 @@ export default defineConfig(({ mode }) => {
12
12
vue ( ) ,
13
13
! isDemo && dts ( {
14
14
include : [ 'src/**/*.ts' , 'src/**/*.vue' ] ,
15
+ copyDtsFiles : true ,
15
16
} )
16
17
] . filter ( Boolean ) ,
17
18
build : {
18
19
outDir : isDemo ? 'demo-dist' : 'dist' ,
19
- cssCodeSplit : true ,
20
+ cssCodeSplit : false , // 禁用 CSS 代码分割,将所有 CSS 打包到一个文件
20
21
...( isDemo ? {
21
22
// 演示页面构建配置
22
23
rollupOptions : {
@@ -38,10 +39,7 @@ export default defineConfig(({ mode }) => {
38
39
vue : 'Vue' ,
39
40
'element-plus' : 'ElementPlus'
40
41
} ,
41
- assetFileNames : ( assetInfo ) => {
42
- if ( assetInfo . name === 'style.css' ) return 'index.css' ;
43
- return assetInfo . name ;
44
- }
42
+ assetFileNames : 'index.css' // 直接指定 CSS 文件名
45
43
}
46
44
}
47
45
} )
You can’t perform that action at this time.
0 commit comments