-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: auto import css plugin (#2613)
* feat: add * feat: 修复类型问题,修改测试用例 * feat: 修复类型问题,修改测试用例 * feat: 树摇支持按需引入 css * feat: 增加说明文件 * chore: delete .vite * chore: merge branch 'V3.0' into feat/taro-plugin # Conflicts: # pnpm-lock.yaml * chore: merge branch 'V3.0' into feat/taro-plugin # Conflicts: # pnpm-lock.yaml * chore: merge branch 'V3.0' into feat/taro-plugin # Conflicts: # pnpm-lock.yaml * chore: merge branch 'V3.0' into feat/taro-plugin # Conflicts: # pnpm-lock.yaml * chore: merge branch 'V3.0' into feat/taro-plugin # Conflicts: # pnpm-lock.yaml * test: merge # Conflicts: # pnpm-lock.yaml * test: merge # Conflicts: # pnpm-lock.yaml * test: merge # Conflicts: # pnpm-lock.yaml * test: merge # Conflicts: # pnpm-lock.yaml * chore: update package
- Loading branch information
1 parent
bec0315
commit d92c50a
Showing
27 changed files
with
7,564 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
node_modules | ||
.idea | ||
.eslintcache | ||
.vite | ||
/dist | ||
/dist-demo | ||
/libs | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
root = true | ||
|
||
[*] | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
node_modules | ||
.DS_Store | ||
dist | ||
*.log | ||
.vercel | ||
.eslintcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright © 2024-PRESENT 三咲智子 (https://github.com/sxzz) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# @nutui/nutui-react-auto-import | ||
|
||
按需引入组件的样式文件。 | ||
|
||
支持情况参考 [https://unplugin.unjs.io/guide/](https://unplugin.unjs.io/guide/) | ||
|
||
## 使用方式 | ||
|
||
vite | ||
|
||
```js | ||
import NutUIAutoImport from '@nutui/nutui-react-auto-import/vite' | ||
import { defineConfig } from 'vite' | ||
|
||
export default defineConfig({ | ||
plugins: [ | ||
NutUIAutoImport({ | ||
libraryName: '@nutui/nutui-react', | ||
style: 'css', | ||
}), | ||
], | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/preset-react"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"name": "@nutui/nutui-react-auto-import", | ||
"version": "0.0.1", | ||
"packageManager": "pnpm@9.11.0", | ||
"description": "NutUI React 组件的自动导入插件,支持多种构建工具如 Vite、Webpack、Rollup 等。", | ||
"type": "module", | ||
"keywords": [ | ||
"unplugin", | ||
"rollup", | ||
"vite", | ||
"esbuild", | ||
"webpack" | ||
], | ||
"license": "MIT", | ||
"homepage": "https://github.com/jdf2e/nutui-react.git", | ||
"bugs": { | ||
"url": "https://github.com/jdf2e/nutui-react.git" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jdf2e/nutui-react.git" | ||
}, | ||
"author": "oasis", | ||
"files": [ | ||
"dist" | ||
], | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.js" | ||
}, | ||
"./vite": { | ||
"require": "./dist/vite.cjs", | ||
"import": "./dist/vite.js" | ||
}, | ||
"./webpack": { | ||
"require": "./dist/webpack.cjs", | ||
"import": "./dist/webpack.js" | ||
}, | ||
"./rspack": { | ||
"require": "./dist/rspack.cjs", | ||
"import": "./dist/rspack.js" | ||
}, | ||
"./rollup": { | ||
"require": "./dist/rollup.cjs", | ||
"import": "./dist/rollup.js" | ||
}, | ||
"./rolldown": { | ||
"require": "./dist/rolldown.cjs", | ||
"import": "./dist/rolldown.js" | ||
}, | ||
"./esbuild": { | ||
"require": "./dist/esbuild.cjs", | ||
"import": "./dist/esbuild.js" | ||
}, | ||
"./api": { | ||
"require": "./dist/api.cjs", | ||
"import": "./dist/api.js" | ||
}, | ||
"./*": [ | ||
"./*", | ||
"./*.d.ts" | ||
] | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"./dist/*", | ||
"./*" | ||
] | ||
} | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"lint": "eslint --cache .", | ||
"lint:fix": "pnpm run lint --fix", | ||
"build": "tsup", | ||
"dev": "tsup --watch", | ||
"test": "vitest", | ||
"typecheck": "tsc --noEmit", | ||
"release": "bumpp && pnpm publish", | ||
"prepublishOnly": "pnpm run build" | ||
}, | ||
"dependencies": { | ||
"@rollup/pluginutils": "^5.1.1", | ||
"@types/babel__traverse": "^7.20.6", | ||
"estree-walker": "^3.0.3", | ||
"magic-string": "^0.30.11", | ||
"unplugin": "^1.14.1" | ||
}, | ||
"devDependencies": { | ||
"@nutui/nutui-react": "^2.6.22", | ||
"@babel/core": "^7.25.8", | ||
"@babel/preset-react": "^7.25.7", | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@sxzz/eslint-config": "^4.2.0", | ||
"@sxzz/prettier-config": "^2.0.2", | ||
"@sxzz/test-utils": "^0.3.2", | ||
"@types/node": "^22.5.5", | ||
"bumpp": "^9.5.2", | ||
"eslint": "^9.11.0", | ||
"fast-glob": "^3.3.2", | ||
"prettier": "^3.3.3", | ||
"tsup": "^8.3.0", | ||
"tsx": "^4.19.1", | ||
"typescript": "^5.6.2", | ||
"vite": "^5.4.7", | ||
"vitest": "^2.1.1" | ||
}, | ||
"engines": { | ||
"node": ">=18.12.0" | ||
} | ||
} |
Oops, something went wrong.