Skip to content

Simon-He95/unplugin-export-type

Repository files navigation

unplugin-export-type

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

Resolve

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

Install

install

🌈 Usage

Vite
// vite.config.ts
import { vitePluginPlugin } from 'unplugin-export-type'
export default defineConfig({
  plugins: [vitePluginPlugin(/* options */)],
})

Rollup
// rollup.config.js
import { resolve } from 'path'
import { rollupPlugin } from 'unplugin-export-type'
export default {
  plugins: [rollupPlugin(/* options */)],
}

Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-export-type').webpackPlugin({
      /* options */
    }),
  ],
}

Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-export-type').webpackPlugin({
        /* options */
      }),
    ],
  },
}

Esbuild
// esbuild.config.js
import { build } from 'esbuild'
import { esbuildPlugin } from 'unplugin-export-type'

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

Example

License

MIT License © 2022 Simon He

Buy Me A Coffee

sponsors

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published