0.0.4 • Published 1 year ago

unplugin-export-type v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

unplugin-export-type

为了支持在vue3中setup语法不支持动态导入类型而写的plugin

Resolve

想要复用类型会动态导入再传入,会发生这样的错误 example

Install

install

🌈 Usage

// vite.config.ts
import { vitePluginPlugin } from 'unplugin-export-type'
export default defineConfig({
  plugins: [vitePluginPlugin(/* options */)],
})
// rollup.config.js
import { resolve } from 'path'
import { rollupPlugin } from 'unplugin-export-type'
export default {
  plugins: [rollupPlugin(/* options */)],
}
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-export-type').webpackPlugin({
      /* options */
    }),
  ],
}
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-export-type').webpackPlugin({
        /* options */
      }),
    ],
  },
}
// esbuild.config.js
import { build } from 'esbuild'
import { esbuildPlugin } from 'unplugin-export-type'

build({
  plugins: [esbuildPlugin(/* options */)],
})

Example

License

MIT License © 2022 Simon He

sponsors

0.0.4

1 year ago