feat: add bunder

This commit is contained in:
aibayanyu 2023-05-03 20:09:26 +08:00
parent febc297d5e
commit ae025850b0
3 changed files with 1029 additions and 1 deletions

View File

@ -13,13 +13,23 @@
], ],
"license": "MIT", "license": "MIT",
"author": "aibayanyu", "author": "aibayanyu",
"main": "dist/index.js", "main": "lib/index.js",
"module": "es/index.js",
"types": "lib/index.d.ts",
"files": [
"lib",
"es",
"dist",
"README.md"
],
"scripts": { "scripts": {
"test": "vitest", "test": "vitest",
"prepare": "husky install", "prepare": "husky install",
"dev": "vitepress dev", "dev": "vitepress dev",
"build:site": "vitepress build", "build:site": "vitepress build",
"build:lib": "vite build --config vite.build.config.ts", "build:lib": "vite build --config vite.build.config.ts",
"build:umd": "vite build --config vite.bundle.config.ts",
"copy:css": "cpx \"components/style/*.css\" dist",
"preview": "vitepress preview" "preview": "vitepress preview"
}, },
"dependencies": { "dependencies": {
@ -39,6 +49,7 @@
"@mistjs/tsconfig-vue": "^1.1.2", "@mistjs/tsconfig-vue": "^1.1.2",
"@types/node": "^18.15.10", "@types/node": "^18.15.10",
"@vitejs/plugin-vue-jsx": "^3.0.1", "@vitejs/plugin-vue-jsx": "^3.0.1",
"cpx": "^1.5.0",
"eslint": "^8.36.0", "eslint": "^8.36.0",
"husky": "^8.0.3", "husky": "^8.0.3",
"lint-staged": "^13.2.0", "lint-staged": "^13.2.0",

File diff suppressed because it is too large Load Diff

13
vite.bundle.config.ts Normal file
View File

@ -0,0 +1,13 @@
import { defineConfig } from 'vite'
import vueJsx from '@vitejs/plugin-vue-jsx'
export default defineConfig({
plugins: [vueJsx()],
build: {
lib: {
entry: 'components/index.ts',
name: 'Antd',
fileName: () => `antd.js`,
formats: ['umd']
}
}
})