unplugin-naily-reflector
v0.1.1
Published
Simple reflection library based on TypeScript written using unplugin, so you can use it in vite, rspack, nuxt, webpack, etc.
Downloads
97
Maintainers
Readme
unplugin-naily-reflector
A reflector for TypeScript files. It's can extract classes
and interface declarations
from .ts
files (currently only support .ts
files, .vue
files will be supported in the future, welcome to contribute).
Base on unplugin, it can be used in Vite, Rollup, Webpack, Nuxt, Vue CLI, and more.
Install
npm i unplugin-naily-reflector
// vite.config.ts
import Starter from 'unplugin-naily-reflector/vite'
export default defineConfig({
plugins: [
Starter({ /* options */ }),
],
})
Example: playground/
// rollup.config.js
import Starter from 'unplugin-naily-reflector/rollup'
export default {
plugins: [
Starter({ /* options */ }),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-naily-reflector/webpack')({ /* options */ })
]
}
// nuxt.config.js
export default defineNuxtConfig({
modules: [
['unplugin-naily-reflector/nuxt', { /* options */ }],
],
})
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-naily-reflector/webpack')({ /* options */ }),
],
},
}
// esbuild.config.js
import { build } from 'esbuild'
import Starter from 'unplugin-naily-reflector/esbuild'
build({
plugins: [Starter()],
})