hw-cus-ui 1.0.15 → 1.0.16
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/hw-cus-ui.css +2 -0
- package/hw-cus-ui.es.js +17 -0
- package/hw-cus-ui.umd.js +1 -0
- package/package.json +3 -30
- package/types/components/HwBtn/HwBtn.vue.d.ts +3 -0
- package/types/components/HwBtn/index.d.ts +2 -0
- package/types/components/index.d.ts +7 -0
- package/.vscode/extensions.json +0 -3
- package/README.md +0 -70
- package/index.html +0 -13
- package/package copy.json +0 -37
- package/scripts/build-types.js +0 -21
- package/src/App.vue +0 -30
- package/src/assets/vue.svg +0 -1
- package/src/components/HelloWorld.vue +0 -41
- package/src/components/HwBtn/HwBtn.vue +0 -16
- package/src/components/HwBtn/index.ts +0 -10
- package/src/components/index.ts +0 -24
- package/src/components/types/components.d.ts +0 -13
- package/src/components/types/index.d.ts +0 -15
- package/src/main.ts +0 -5
- package/src/style.css +0 -79
- package/tsconfig.app.json +0 -20
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/tsconfig.types.json +0 -33
- package/vite.config.ts +0 -42
- /package/{public/vite.svg → vite.svg} +0 -0
package/hw-cus-ui.css
ADDED
package/hw-cus-ui.es.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createElementBlock, openBlock } from "vue";
|
|
2
|
+
var __plugin_vue_export_helper_default = (e, s) => {
|
|
3
|
+
let c = e.__vccOpts || e;
|
|
4
|
+
for (let [e, l] of s) c[e] = l;
|
|
5
|
+
return c;
|
|
6
|
+
}, _sfc_main = {}, _hoisted_1 = { class: "btn" };
|
|
7
|
+
function _sfc_render(c, l) {
|
|
8
|
+
return openBlock(), createElementBlock("div", _hoisted_1, "我的按钮");
|
|
9
|
+
}
|
|
10
|
+
var HwBtn_default$1 = /* @__PURE__ */ __plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-6693a7d0"]]);
|
|
11
|
+
HwBtn_default$1.install = (e) => {
|
|
12
|
+
e.component(HwBtn_default$1.__name, HwBtn_default$1);
|
|
13
|
+
};
|
|
14
|
+
var HwBtn_default = HwBtn_default$1, components = [HwBtn_default], components_default = { install: (e) => {
|
|
15
|
+
components.forEach((s) => e.component(s.__name, s));
|
|
16
|
+
} };
|
|
17
|
+
export { HwBtn_default as HwBtn, components_default as default };
|
package/hw-cus-ui.umd.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.hwCusUi={},e.Vue))})(this,function(e,t){Object.defineProperty(e,`__esModule`,{value:!0});var n=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},r={},i={class:`btn`};function a(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,i,`我的按钮`)}var o=n(r,[[`render`,a],[`__scopeId`,`data-v-6693a7d0`]]);o.install=e=>{e.component(o.__name,o)};var s=o,c=[s];e.HwBtn=s,e.default={install:e=>{c.forEach(t=>e.component(t.__name,t))}}});
|
package/package.json
CHANGED
|
@@ -1,35 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hw-cus-ui",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"alien-signals": "^3.1.1",
|
|
8
|
-
"csstype": "^3.2.3",
|
|
9
|
-
"detect-libc": "^2.1.2",
|
|
10
|
-
"entities": "^7.0.0",
|
|
11
|
-
"estree-walker": "^2.0.2",
|
|
12
|
-
"fdir": "^6.5.0",
|
|
13
|
-
"lightningcss": "^1.30.2",
|
|
14
|
-
"lightningcss-win32-x64-msvc": "^1.30.2",
|
|
15
|
-
"magic-string": "^0.30.21",
|
|
16
|
-
"muggle-string": "^0.4.1",
|
|
17
|
-
"nanoid": "^3.3.11",
|
|
18
|
-
"path-browserify": "^1.0.1",
|
|
19
|
-
"picocolors": "^1.1.1",
|
|
20
|
-
"picomatch": "^4.0.3",
|
|
21
|
-
"postcss": "^8.5.6",
|
|
22
|
-
"rolldown": "^1.0.0-beta.50",
|
|
23
|
-
"source-map-js": "^1.2.1",
|
|
24
|
-
"tinyglobby": "^0.2.15",
|
|
25
|
-
"typescript": "^5.9.3",
|
|
26
|
-
"undici-types": "^7.16.0",
|
|
27
|
-
"vite": "^7.2.5",
|
|
28
|
-
"vscode-uri": "^3.1.0",
|
|
29
|
-
"vue": "^3.5.26",
|
|
30
|
-
"vue-tsc": "^3.2.1"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {},
|
|
3
|
+
"version": "1.0.16",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "hw-cus-ui.es.js",
|
|
33
6
|
"scripts": {
|
|
34
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
35
8
|
},
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
package/.vscode/extensions.json
DELETED
package/README.md
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# hw-cus-ui
|
|
2
|
-
|
|
3
|
-
一个基于 Vue 3 的组件库,包含常用的UI组件。
|
|
4
|
-
|
|
5
|
-
## 安装
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @yourname/hw-cus-ui
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 使用
|
|
12
|
-
|
|
13
|
-
### 全局注册
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { createApp } from 'vue'
|
|
17
|
-
import App from './App.vue'
|
|
18
|
-
import hwCusUi from '@yourname/hw-cus-ui'
|
|
19
|
-
import '@yourname/hw-cus-ui/dist/hw-cus-ui.css'
|
|
20
|
-
|
|
21
|
-
const app = createApp(App)
|
|
22
|
-
|
|
23
|
-
app.use(hwCusUi)
|
|
24
|
-
app.mount('#app')
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### 按需引入
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
import { createApp } from 'vue'
|
|
31
|
-
import App from './App.vue'
|
|
32
|
-
import { HwBtn } from '@yourname/hw-cus-ui'
|
|
33
|
-
import '@yourname/hw-cus-ui/dist/hw-cus-ui.css'
|
|
34
|
-
|
|
35
|
-
const app = createApp(App)
|
|
36
|
-
|
|
37
|
-
app.component('HwBtn', HwBtn)
|
|
38
|
-
app.mount('#app')
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## 组件列表
|
|
42
|
-
|
|
43
|
-
- HwBtn (按钮组件)
|
|
44
|
-
|
|
45
|
-
## 开发
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
# 安装依赖
|
|
49
|
-
npm install
|
|
50
|
-
|
|
51
|
-
# 启动开发服务器
|
|
52
|
-
npm run dev
|
|
53
|
-
|
|
54
|
-
# 构建组件库
|
|
55
|
-
npm run build
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## 发布到npm
|
|
59
|
-
|
|
60
|
-
在发布前,请注意:
|
|
61
|
-
|
|
62
|
-
1. 将 package.json 中的 `@yourname/hw-cus-ui` 替换为你的实际npm用户名
|
|
63
|
-
2. 登录npm账户: `npm login`
|
|
64
|
-
3. 确保版本号更新
|
|
65
|
-
4. 运行构建命令: `npm run build`
|
|
66
|
-
5. 发布: `npm publish`
|
|
67
|
-
|
|
68
|
-
## License
|
|
69
|
-
|
|
70
|
-
MIT
|
package/index.html
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>my-vue-app</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="app"></div>
|
|
11
|
-
<script type="module" src="/src/main.ts"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
package/package copy.json
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "hw-cus-ui",
|
|
3
|
-
"version": "1.0.14",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "./dist/hw-cus-ui.umd.js",
|
|
6
|
-
"types": "./dist/types/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"dev": "vite",
|
|
12
|
-
"build": "vue-tsc -b && vite build && vue-tsc -p tsconfig.types.json",
|
|
13
|
-
"preview": "vite preview",
|
|
14
|
-
"lib": "vue-tsc -b && vite build --mode lib"
|
|
15
|
-
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"vue": "^3.5.24"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@types/node": "^24.10.1",
|
|
21
|
-
"@vitejs/plugin-vue": "^6.0.1",
|
|
22
|
-
"@vue/tsconfig": "^0.8.1",
|
|
23
|
-
"typescript": "~5.9.3",
|
|
24
|
-
"vite": "npm:rolldown-vite@7.2.5",
|
|
25
|
-
"vue-tsc": "^3.1.4"
|
|
26
|
-
},
|
|
27
|
-
"resolutions": {
|
|
28
|
-
"vite": "npm:rolldown-vite@7.2.5"
|
|
29
|
-
},
|
|
30
|
-
"peerDependencies": {
|
|
31
|
-
"vue": "^3.5.24"
|
|
32
|
-
},
|
|
33
|
-
"description": "一个基于 Vue 3 的组件库,包含常用的UI组件。",
|
|
34
|
-
"keywords": [],
|
|
35
|
-
"author": "",
|
|
36
|
-
"license": "ISC"
|
|
37
|
-
}
|
package/scripts/build-types.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
import { existsSync, mkdirSync } from 'fs';
|
|
3
|
-
import { resolve } from 'path';
|
|
4
|
-
|
|
5
|
-
const projectRoot = resolve('.');
|
|
6
|
-
const distPath = resolve(projectRoot, 'dist');
|
|
7
|
-
const typesPath = resolve(distPath, 'types');
|
|
8
|
-
|
|
9
|
-
// 创建类型目录
|
|
10
|
-
if (!existsSync(typesPath)) {
|
|
11
|
-
mkdirSync(typesPath, { recursive: true });
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// 生成类型声明文件
|
|
15
|
-
try {
|
|
16
|
-
execSync('npx vue-tsc --declaration --emitDeclarationOnly --outDir dist/types', { stdio: 'inherit' });
|
|
17
|
-
console.log('类型声明文件生成成功');
|
|
18
|
-
} catch (error) {
|
|
19
|
-
console.error('类型声明文件生成失败:', error.message);
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
package/src/App.vue
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import HelloWorld from './components/HelloWorld.vue'
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<template>
|
|
6
|
-
<div>
|
|
7
|
-
<a href="https://vite.dev" target="_blank">
|
|
8
|
-
<img src="/vite.svg" class="logo" alt="Vite logo" />
|
|
9
|
-
</a>
|
|
10
|
-
<a href="https://vuejs.org/" target="_blank">
|
|
11
|
-
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
|
|
12
|
-
</a>
|
|
13
|
-
</div>
|
|
14
|
-
<HelloWorld msg="Vite + Vue" />
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<style scoped>
|
|
18
|
-
.logo {
|
|
19
|
-
height: 6em;
|
|
20
|
-
padding: 1.5em;
|
|
21
|
-
will-change: filter;
|
|
22
|
-
transition: filter 300ms;
|
|
23
|
-
}
|
|
24
|
-
.logo:hover {
|
|
25
|
-
filter: drop-shadow(0 0 2em #646cffaa);
|
|
26
|
-
}
|
|
27
|
-
.logo.vue:hover {
|
|
28
|
-
filter: drop-shadow(0 0 2em #42b883aa);
|
|
29
|
-
}
|
|
30
|
-
</style>
|
package/src/assets/vue.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
|
|
4
|
-
defineProps<{ msg: string }>()
|
|
5
|
-
|
|
6
|
-
const count = ref(0)
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<h1>{{ msg }}</h1>
|
|
11
|
-
|
|
12
|
-
<div class="card">
|
|
13
|
-
<button type="button" @click="count++">count is {{ count }}</button>
|
|
14
|
-
<p>
|
|
15
|
-
Edit
|
|
16
|
-
<code>components/HelloWorld.vue</code> to test HMR
|
|
17
|
-
</p>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<p>
|
|
21
|
-
Check out
|
|
22
|
-
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
|
|
23
|
-
>create-vue</a
|
|
24
|
-
>, the official Vue + Vite starter
|
|
25
|
-
</p>
|
|
26
|
-
<p>
|
|
27
|
-
Learn more about IDE Support for Vue in the
|
|
28
|
-
<a
|
|
29
|
-
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
|
|
30
|
-
target="_blank"
|
|
31
|
-
>Vue Docs Scaling up Guide</a
|
|
32
|
-
>.
|
|
33
|
-
</p>
|
|
34
|
-
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
|
|
35
|
-
</template>
|
|
36
|
-
|
|
37
|
-
<style scoped>
|
|
38
|
-
.read-the-docs {
|
|
39
|
-
color: #888;
|
|
40
|
-
}
|
|
41
|
-
</style>
|
package/src/components/index.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// index.ts
|
|
2
|
-
import type { App } from 'vue'
|
|
3
|
-
import HwBtn from './HwBtn'
|
|
4
|
-
|
|
5
|
-
// 所有组件列表
|
|
6
|
-
const components = [
|
|
7
|
-
HwBtn,
|
|
8
|
-
]
|
|
9
|
-
|
|
10
|
-
// 定义 install 方法
|
|
11
|
-
const install = (app: App): void => {
|
|
12
|
-
// 遍历注册所有组件
|
|
13
|
-
components.forEach(component => app.component(component.__name as string, component))
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
HwBtn,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const hwCusUi = {
|
|
21
|
-
install
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default hwCusUi
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DefineComponent } from 'vue'
|
|
2
|
-
|
|
3
|
-
export declare const HwBtn: DefineComponent
|
|
4
|
-
|
|
5
|
-
export interface InstallFunction {
|
|
6
|
-
(app: import('vue').App): void
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export declare const hwCusUi: {
|
|
10
|
-
install: InstallFunction
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default hwCusUi
|
package/src/main.ts
DELETED
package/src/style.css
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
3
|
-
line-height: 1.5;
|
|
4
|
-
font-weight: 400;
|
|
5
|
-
|
|
6
|
-
color-scheme: light dark;
|
|
7
|
-
color: rgba(255, 255, 255, 0.87);
|
|
8
|
-
background-color: #242424;
|
|
9
|
-
|
|
10
|
-
font-synthesis: none;
|
|
11
|
-
text-rendering: optimizeLegibility;
|
|
12
|
-
-webkit-font-smoothing: antialiased;
|
|
13
|
-
-moz-osx-font-smoothing: grayscale;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
a {
|
|
17
|
-
font-weight: 500;
|
|
18
|
-
color: #646cff;
|
|
19
|
-
text-decoration: inherit;
|
|
20
|
-
}
|
|
21
|
-
a:hover {
|
|
22
|
-
color: #535bf2;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
body {
|
|
26
|
-
margin: 0;
|
|
27
|
-
display: flex;
|
|
28
|
-
place-items: center;
|
|
29
|
-
min-width: 320px;
|
|
30
|
-
min-height: 100vh;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
h1 {
|
|
34
|
-
font-size: 3.2em;
|
|
35
|
-
line-height: 1.1;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
button {
|
|
39
|
-
border-radius: 8px;
|
|
40
|
-
border: 1px solid transparent;
|
|
41
|
-
padding: 0.6em 1.2em;
|
|
42
|
-
font-size: 1em;
|
|
43
|
-
font-weight: 500;
|
|
44
|
-
font-family: inherit;
|
|
45
|
-
background-color: #1a1a1a;
|
|
46
|
-
cursor: pointer;
|
|
47
|
-
transition: border-color 0.25s;
|
|
48
|
-
}
|
|
49
|
-
button:hover {
|
|
50
|
-
border-color: #646cff;
|
|
51
|
-
}
|
|
52
|
-
button:focus,
|
|
53
|
-
button:focus-visible {
|
|
54
|
-
outline: 4px auto -webkit-focus-ring-color;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.card {
|
|
58
|
-
padding: 2em;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
#app {
|
|
62
|
-
max-width: 1280px;
|
|
63
|
-
margin: 0 auto;
|
|
64
|
-
padding: 2rem;
|
|
65
|
-
text-align: center;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@media (prefers-color-scheme: light) {
|
|
69
|
-
:root {
|
|
70
|
-
color: #213547;
|
|
71
|
-
background-color: #ffffff;
|
|
72
|
-
}
|
|
73
|
-
a:hover {
|
|
74
|
-
color: #747bff;
|
|
75
|
-
}
|
|
76
|
-
button {
|
|
77
|
-
background-color: #f9f9f9;
|
|
78
|
-
}
|
|
79
|
-
}
|
package/tsconfig.app.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
|
3
|
-
"include": ["env.d.ts", "src/**/*", "src/**/*.vue", "src/components/types/**/*.d.ts"],
|
|
4
|
-
"exclude": ["src/**/__tests__/*"],
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"composite": true,
|
|
7
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
8
|
-
"baseUrl": ".",
|
|
9
|
-
"paths": {
|
|
10
|
-
"@/*": ["./src/*"]
|
|
11
|
-
},
|
|
12
|
-
"types": ["vite/client"],
|
|
13
|
-
/* Linting */
|
|
14
|
-
"strict": true,
|
|
15
|
-
"noUnusedLocals": true,
|
|
16
|
-
"noUnusedParameters": true,
|
|
17
|
-
"noFallthroughCasesInSwitch": true,
|
|
18
|
-
"noUncheckedSideEffectImports": true
|
|
19
|
-
}
|
|
20
|
-
}
|
package/tsconfig.json
DELETED
package/tsconfig.node.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
-
"target": "ES2023",
|
|
5
|
-
"lib": ["ES2023"],
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"types": ["node"],
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"verbatimModuleSyntax": true,
|
|
14
|
-
"moduleDetection": "force",
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
/* Linting */
|
|
18
|
-
"strict": true,
|
|
19
|
-
"noUnusedLocals": true,
|
|
20
|
-
"noUnusedParameters": true,
|
|
21
|
-
"erasableSyntaxOnly": true,
|
|
22
|
-
"noFallthroughCasesInSwitch": true,
|
|
23
|
-
"noUncheckedSideEffectImports": true
|
|
24
|
-
},
|
|
25
|
-
"include": ["vite.config.ts"]
|
|
26
|
-
}
|
package/tsconfig.types.json
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"jsx": "preserve",
|
|
8
|
-
"sourceMap": true,
|
|
9
|
-
"resolveJsonModule": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"lib": [
|
|
12
|
-
"ES2020",
|
|
13
|
-
"DOM",
|
|
14
|
-
"DOM.Iterable"
|
|
15
|
-
],
|
|
16
|
-
"declaration": true,
|
|
17
|
-
"emitDeclarationOnly": true,
|
|
18
|
-
"outDir": "./dist/types",
|
|
19
|
-
"rootDir": "./src",
|
|
20
|
-
"types": ["vite/client", "node"],
|
|
21
|
-
"allowSyntheticDefaultImports": true,
|
|
22
|
-
"skipLibCheck": true
|
|
23
|
-
},
|
|
24
|
-
"include": [
|
|
25
|
-
"src/components/index.ts",
|
|
26
|
-
"src/components/HwBtn/index.ts",
|
|
27
|
-
"src/components/HwBtn/HwBtn.vue",
|
|
28
|
-
"src/components/types/**/*.d.ts"
|
|
29
|
-
],
|
|
30
|
-
"exclude": [
|
|
31
|
-
"node_modules"
|
|
32
|
-
]
|
|
33
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import vue from '@vitejs/plugin-vue'
|
|
3
|
-
import { resolve } from 'path';
|
|
4
|
-
|
|
5
|
-
const pathResolve = (dir: string) => {
|
|
6
|
-
return resolve(__dirname, '.', dir);
|
|
7
|
-
};
|
|
8
|
-
const alias: Record<string, string> = {
|
|
9
|
-
'@': pathResolve('./src'),
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
// https://vitejs.dev/config/
|
|
13
|
-
export default defineConfig({
|
|
14
|
-
plugins: [vue()],
|
|
15
|
-
base:'./',
|
|
16
|
-
build:{
|
|
17
|
-
outDir: 'dist', // 修改输出目录
|
|
18
|
-
lib:{
|
|
19
|
-
entry: resolve(__dirname, './src/components/index.ts'), //指定组件编译入口文件
|
|
20
|
-
name: 'hwCusUi', // 修改库名称
|
|
21
|
-
fileName: (format) => `hw-cus-ui.${format}.js` // 生成不同格式的文件
|
|
22
|
-
},//库编译模式配置
|
|
23
|
-
rollupOptions: {
|
|
24
|
-
external: ['vue'],
|
|
25
|
-
output: {
|
|
26
|
-
exports: 'named',
|
|
27
|
-
globals: {
|
|
28
|
-
vue:'Vue',
|
|
29
|
-
},
|
|
30
|
-
assetFileNames: (assetInfo) => {
|
|
31
|
-
if (assetInfo.name === 'style.css') {
|
|
32
|
-
return 'style.css';
|
|
33
|
-
}
|
|
34
|
-
return assetInfo.name || '';
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
resolve: {
|
|
40
|
-
alias,
|
|
41
|
-
}
|
|
42
|
-
})
|
|
File without changes
|