mm
This commit is contained in:
@@ -13,22 +13,13 @@
|
|||||||
"docs/[^.]*",
|
"docs/[^.]*",
|
||||||
"doc/[^.]*"
|
"doc/[^.]*"
|
||||||
],
|
],
|
||||||
|
"module": "index.js",
|
||||||
"typings": "index.d.ts",
|
"typings": "index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
|
||||||
"import": {
|
|
||||||
"types": "./dist/index.d.ts",
|
|
||||||
"default": "./dist/index.js"
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"types": "./dist/index.d.ts",
|
|
||||||
"default": "./dist/index.cjs.js"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"./index.css": "./dist/index.css"
|
"./index.css": "./dist/index.css"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc --project tsconfig.build.json"
|
"build": "vite build && tsc --project tsconfig.build.json"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@floating-ui/react": "^0.27.20",
|
"@floating-ui/react": "^0.27.20",
|
||||||
@@ -37,7 +28,22 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^26.6.6",
|
"@types/node": "^26.6.6",
|
||||||
"@types/react": "^19.3.0",
|
"@types/react": "^19.3.0",
|
||||||
"@types/react-dom": "^19.3.0"
|
"@types/react-dom": "^19.3.0",
|
||||||
|
"@babel/core": "^7.29.13",
|
||||||
|
"@eslint/js": "^10.0.1",
|
||||||
|
"@rolldown/plugin-babel": "^0.3.1",
|
||||||
|
"@types/babel__core": "^7.20.5",
|
||||||
|
"@vitejs/devtools": "^0.8.3",
|
||||||
|
"@vitejs/devtools-rolldown": "^0.8.3",
|
||||||
|
"@vitejs/devtools-vite": "^0.8.3",
|
||||||
|
"@vitejs/plugin-react": "^6.3.0",
|
||||||
|
"babel-plugin-react-compiler": "^1.0.0",
|
||||||
|
"eslint": "^10.15.0",
|
||||||
|
"eslint-plugin-react-hooks": "^7.1.1",
|
||||||
|
"eslint-plugin-react-refresh": "^0.5.8",
|
||||||
|
"globals": "^17.14.0",
|
||||||
|
"typescript": "~6.0.3",
|
||||||
|
"typescript-eslint": "^8.73.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^19.3.1",
|
"react": "^19.3.1",
|
||||||
|
|||||||
@@ -9,10 +9,12 @@
|
|||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
// 所有项目必须开,兼容 es 和 cjs 导入,允许 import React from 'react' ,而非 import * as React 。
|
// 所有项目必须开,兼容 es 和 cjs 导入,允许 import React from 'react' ,而非 import * as React 。
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
// 允许导入 ts,tsx 扩展名,include 里可以省略后缀。
|
// 允许导入 ts,tsx 扩展名。
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
// 允许 js,jsx 扩展名,include 里可以省略后缀。
|
// 允许导入 js,jsx 扩展名。
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
// 允许导入 json 模块,而不只是 ts,js,css 。
|
||||||
|
"resolveJsonModule": true,
|
||||||
// 启用装饰器,也就是 @XXX 注解。
|
// 启用装饰器,也就是 @XXX 注解。
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
// 发射装饰器元数据。
|
// 发射装饰器元数据。
|
||||||
@@ -37,7 +39,7 @@
|
|||||||
"incremental": true
|
"incremental": true
|
||||||
},
|
},
|
||||||
// 本配置文件的作用范围,包含根目录下的一切文件,包括 vite.config.ts 等配置文件
|
// 本配置文件的作用范围,包含根目录下的一切文件,包括 vite.config.ts 等配置文件
|
||||||
"include": ["**/*.ts",],
|
"include": ["**/*.ts", "*/*.tsx"],
|
||||||
// 本配置文件排除的范围。
|
// 本配置文件排除的范围。
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import react, { reactCompilerPreset } from "@vitejs/plugin-react";
|
||||||
|
import babel from "@rolldown/plugin-babel";
|
||||||
|
import { defineConfig } from "vite";
|
||||||
|
import { resolve } from "path";
|
||||||
|
import pkg from "./package.json" with { type: "json" };
|
||||||
|
|
||||||
|
// https://vite.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
devtools: {
|
||||||
|
// Remove this `apply` property to enable devtools for build as well
|
||||||
|
// apply: 'serve',
|
||||||
|
},
|
||||||
|
plugins: [react(), babel({ presets: [reactCompilerPreset()] })],
|
||||||
|
|
||||||
|
build: {
|
||||||
|
// Must write, vite/css-minify cannot recognize some ruler
|
||||||
|
cssMinify: false,
|
||||||
|
lib: {
|
||||||
|
entry: resolve(import.meta.dirname, "src/index.ts"),
|
||||||
|
name: "ui-react",
|
||||||
|
formats: ["es"],
|
||||||
|
fileName: (format) => {
|
||||||
|
return `index.${format}.js`;
|
||||||
|
},
|
||||||
|
cssFileName: "index",
|
||||||
|
},
|
||||||
|
rolldownOptions: {
|
||||||
|
external: ["react/jsx-runtime", ...Object.keys(pkg.peerDependencies)],
|
||||||
|
output: {
|
||||||
|
// 为 UMD 构建提供 global 变量
|
||||||
|
globals: {
|
||||||
|
react: "React",
|
||||||
|
"react-dom": "ReactDOM",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
Generated
+45
@@ -93,6 +93,18 @@ importers:
|
|||||||
specifier: ^5.4.0
|
specifier: ^5.4.0
|
||||||
version: 5.4.0(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
|
version: 5.4.0(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
|
||||||
devDependencies:
|
devDependencies:
|
||||||
|
'@babel/core':
|
||||||
|
specifier: ^7.29.13
|
||||||
|
version: 7.29.13
|
||||||
|
'@eslint/js':
|
||||||
|
specifier: ^10.0.1
|
||||||
|
version: 10.0.1(eslint@10.15.0)
|
||||||
|
'@rolldown/plugin-babel':
|
||||||
|
specifier: ^0.3.1
|
||||||
|
version: 0.3.2(@babel/core@7.29.13)(rolldown@1.3.4)(vite@8.4.0)
|
||||||
|
'@types/babel__core':
|
||||||
|
specifier: ^7.20.5
|
||||||
|
version: 7.20.5
|
||||||
'@types/node':
|
'@types/node':
|
||||||
specifier: ^26.6.6
|
specifier: ^26.6.6
|
||||||
version: 26.6.11
|
version: 26.6.11
|
||||||
@@ -102,6 +114,39 @@ importers:
|
|||||||
'@types/react-dom':
|
'@types/react-dom':
|
||||||
specifier: ^19.3.0
|
specifier: ^19.3.0
|
||||||
version: 19.3.0(@types/react@19.3.3)
|
version: 19.3.0(@types/react@19.3.3)
|
||||||
|
'@vitejs/devtools':
|
||||||
|
specifier: ^0.8.3
|
||||||
|
version: 0.8.3(@vitejs/devtools-rolldown@0.8.3)(@vitejs/devtools-vite@0.8.3)(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(vite@8.4.0)
|
||||||
|
'@vitejs/devtools-rolldown':
|
||||||
|
specifier: ^0.8.3
|
||||||
|
version: 0.8.3(@devframes/agentic@1.4.0)(cac@7.1.1)(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(vite@8.4.0)
|
||||||
|
'@vitejs/devtools-vite':
|
||||||
|
specifier: ^0.8.3
|
||||||
|
version: 0.8.3(@devframes/agentic@1.4.0)(cac@7.1.1)(crossws@0.4.17(srvx@1.0.8))(srvx@1.0.8)(vite@8.4.0)
|
||||||
|
'@vitejs/plugin-react':
|
||||||
|
specifier: ^6.3.0
|
||||||
|
version: 6.3.0(@rolldown/plugin-babel@0.3.2(@babel/core@7.29.13)(rolldown@1.3.4)(vite@8.4.0))(babel-plugin-react-compiler@1.0.0)(vite@8.4.0)
|
||||||
|
babel-plugin-react-compiler:
|
||||||
|
specifier: ^1.0.0
|
||||||
|
version: 1.0.0
|
||||||
|
eslint:
|
||||||
|
specifier: ^10.15.0
|
||||||
|
version: 10.15.0
|
||||||
|
eslint-plugin-react-hooks:
|
||||||
|
specifier: ^7.1.1
|
||||||
|
version: 7.1.1(eslint@10.15.0)
|
||||||
|
eslint-plugin-react-refresh:
|
||||||
|
specifier: ^0.5.8
|
||||||
|
version: 0.5.8(eslint@10.15.0)
|
||||||
|
globals:
|
||||||
|
specifier: ^17.14.0
|
||||||
|
version: 17.14.0
|
||||||
|
typescript:
|
||||||
|
specifier: ~6.0.3
|
||||||
|
version: 6.0.3
|
||||||
|
typescript-eslint:
|
||||||
|
specifier: ^8.73.0
|
||||||
|
version: 8.74.0(eslint@10.15.0)(typescript@6.0.3)
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user