Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simon-he95/unplugin-export-type
https://github.com/simon-he95/unplugin-export-type
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/simon-he95/unplugin-export-type
- Owner: Simon-He95
- License: mit
- Created: 2023-01-16T05:31:55.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-28T07:40:35.000Z (about 1 month ago)
- Last Synced: 2024-10-22T15:42:57.983Z (15 days ago)
- Language: Vue
- Size: 846 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: license
Awesome Lists containing this project
README
# unplugin-export-type
为了支持在vue3中setup语法不支持动态导入类型而写的plugin## Resolve
想要复用类型会动态导入再传入,会发生这样的错误
![example](/assets/example.png)## Install
![install](/assets/install.png)## 🌈 Usage
Vite
```ts
// vite.config.ts
import { vitePluginPlugin } from 'unplugin-export-type'
export default defineConfig({
plugins: [vitePluginPlugin(/* options */)],
})
```
Rollup
```ts
// rollup.config.js
import { resolve } from 'path'
import { rollupPlugin } from 'unplugin-export-type'
export default {
plugins: [rollupPlugin(/* options */)],
}
```
Webpack
```ts
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-export-type').webpackPlugin({
/* options */
}),
],
}
```
Vue CLI
```ts
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-export-type').webpackPlugin({
/* options */
}),
],
},
}
```
Esbuild
```ts
// esbuild.config.js
import { build } from 'esbuild'
import { esbuildPlugin } from 'unplugin-export-type'build({
plugins: [esbuildPlugin(/* options */)],
})
```[Example](./playground/src/components/Footer.vue)
## License
[MIT](./LICENSE) License © 2022 [Simon He](https://github.com/Simon-He95)
![sponsors](https://www.hejian.club/images/sponsors.jpg)