@hzw-tech/utils 0.0.1
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/.eslintrc-auto-import.json +103 -0
- package/.vscode/extensions.json +12 -0
- package/.vscode/html.code-snippets +25 -0
- package/.vscode/scss.code-snippets +77 -0
- package/.vscode/settings.json +102 -0
- package/.vscode/tailwind.json +56 -0
- package/.vscode/typescript.code-snippets +162 -0
- package/.vscode/vue.code-snippets +40 -0
- package/LICENSE +21 -0
- package/dist/eslint.d.ts +6 -0
- package/dist/eslint.js +43 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/styles/_classes.scss +80 -0
- package/dist/styles/_reset.scss +111 -0
- package/dist/styles/index.css +4927 -0
- package/dist/styles/index.css.map +1 -0
- package/dist/styles/index.scss +2 -0
- package/dist/styles/reference/_config.scss +209 -0
- package/dist/styles/reference/_functions.scss +17 -0
- package/dist/styles/reference/_index.scss +3 -0
- package/dist/styles/reference/_mixins.scss +209 -0
- package/dist/ts/bem.d.ts +49 -0
- package/dist/ts/config.d.ts +13 -0
- package/dist/ts/reg.d.ts +17 -0
- package/dist/ts/request.d.ts +51 -0
- package/dist/ts/utils.d.ts +128 -0
- package/dist/ts/validators.d.ts +29 -0
- package/dist/types/global.d.ts +188 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/window.d.ts +13 -0
- package/dist/vite.d.ts +30 -0
- package/dist/vite.js +42 -0
- package/eslint.config.mjs +3 -0
- package/index.html +12 -0
- package/package.json +56 -0
- package/readme.md +115 -0
- package/rollup.config.mjs +28 -0
- package/tsconfig.json +19 -0
- package/vite.config.mts +38 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import commonjs from '@rollup/plugin-commonjs'
|
|
2
|
+
import resolve from '@rollup/plugin-node-resolve'
|
|
3
|
+
import terser from '@rollup/plugin-terser'
|
|
4
|
+
import typescript from '@rollup/plugin-typescript'
|
|
5
|
+
import copy from 'rollup-plugin-copy'
|
|
6
|
+
import vite from './src/js/vite.js'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
input: 'src/index.ts',
|
|
10
|
+
output: {
|
|
11
|
+
file: 'dist/index.js',
|
|
12
|
+
format: 'es',
|
|
13
|
+
sourcemap: true,
|
|
14
|
+
},
|
|
15
|
+
external: ['mime-db', 'events', 'axios', 'crypto-js', 'element-plus', 'json-bigint'], // 以mime-db为例, 打包无需引入mime-db, 配置external: ['mime-db']即可
|
|
16
|
+
plugins: [
|
|
17
|
+
resolve(),
|
|
18
|
+
commonjs(),
|
|
19
|
+
typescript({
|
|
20
|
+
tsconfig: './tsconfig.json', // 确保使用正确的 tsconfig 文件
|
|
21
|
+
}),
|
|
22
|
+
terser(),
|
|
23
|
+
copy({
|
|
24
|
+
targets: [{ src: 'src/types/**/*', dest: 'dist/types' }, { src: 'src/styles/', dest: 'dist' }, { src: 'src/js/**/*', dest: 'dist' }],
|
|
25
|
+
}),
|
|
26
|
+
vite.autoImport(),
|
|
27
|
+
],
|
|
28
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"jsx": "preserve",
|
|
5
|
+
"lib": ["ESNext", "DOM"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "Node",
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noImplicitThis": false,
|
|
11
|
+
"declaration": true, // 确保生成声明文件
|
|
12
|
+
"declarationDir": "./dist", // 指定声明文件输出目录
|
|
13
|
+
"outDir": "./dist",
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"esModuleInterop": true
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*.ts", "src/js/eslint.js"],
|
|
18
|
+
"exclude": ["node_modules"]
|
|
19
|
+
}
|
package/vite.config.mts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url'
|
|
2
|
+
import vue from '@vitejs/plugin-vue'
|
|
3
|
+
import { defineConfig } from 'vite'
|
|
4
|
+
import vite from './src/js/vite'
|
|
5
|
+
|
|
6
|
+
// https://vitejs.dev/config/
|
|
7
|
+
export default defineConfig(() => {
|
|
8
|
+
return {
|
|
9
|
+
plugins: [
|
|
10
|
+
vue({
|
|
11
|
+
script: { defineModel: true },
|
|
12
|
+
}),
|
|
13
|
+
vite.autoImport(),
|
|
14
|
+
],
|
|
15
|
+
resolve: {
|
|
16
|
+
alias: {
|
|
17
|
+
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
// 内联 postcss 注册 tailwindcss
|
|
21
|
+
css: {
|
|
22
|
+
// https://vitejs.dev/config/shared-options.html#css-preprocessoroptions
|
|
23
|
+
preprocessorOptions: {
|
|
24
|
+
scss: {
|
|
25
|
+
additionalData: '@use "./styles/reference/index.scss" as *;',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
server: {
|
|
30
|
+
proxy: {
|
|
31
|
+
'/cgi': {
|
|
32
|
+
target: 'http://test.hzwcloud.com',
|
|
33
|
+
changeOrigin: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
})
|