Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zys8119/vite-npm-build
vite 编辑npm包
https://github.com/zys8119/vite-npm-build
Last synced: 10 days ago
JSON representation
vite 编辑npm包
- Host: GitHub
- URL: https://github.com/zys8119/vite-npm-build
- Owner: zys8119
- Created: 2024-05-23T08:07:21.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-23T09:20:48.000Z (6 months ago)
- Last Synced: 2024-05-23T09:29:15.786Z (6 months ago)
- Language: TypeScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vite-npm-build
vite 快熟构建npm包
## 使用指南
在`vite.config.ts`中配置入口文件及虚拟文件,虚拟文件用于编译后的文件导出默认模块
```typescript
// 入口文件
const inputFiles = glob.sync(["src/*"], {absolute:false})
// 虚拟文件
const virtualFiles = glob.sync(["**/*.vue"], {absolute:false})
```在`package.json`中修改您的npm包的(版本号、npm包名、main入口、bin脚本、类型等)
```json
{
"name": "vite-npm-build",
"version": "1.0.0",
"main": "index.js",
"bin": "index.js"
}```