| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
unplugin-auto-export is a plugin designed specifically for Vite and Webpack build tools, that automates the maintenance of export statements in index.ts files, reducing the manual effort of writing export statements. It's especially useful in large projects where managing export statements can become cumbersome.
You can install the unplugin-auto-export plugin using npm or yarn:
npm install unplugin-auto-export --save-dev
# or
yarn add unplugin-auto-export --devTo use the unplugin-auto-export plugin in your Vite project, follow these steps:
vite: In your vite.config.js file, import the plugin and specify configuration options:
import { defineConfig } from 'vite';
import AutoExport from 'unplugin-auto-export/vite';
export default defineConfig({
// ... other Vite configuration options
plugins: [
AutoExport({
// Directories to watch, paths can use aliases; It just needs to end with /*
path: ['~/views/**/{components,hooks}/*', '~/hooks/*'],
// Directories or files to ignore (optional)
ignore: ['**/node_modules/*'],
// File extension (default is 'ts') `ts` | `js`
extname: 'ts',
// Custom export format
formatter: (filename, extname) => `export * from './${filename}'`
}),
],
});webpack: In your webpack.config.js file, import the plugin and specify configuration options:
module.exports = {
/* ... */
plugins: [
require('unplugin-auto-export/webpack').default({ /* options */ }),
],
}If you encounter any issues or have suggestions for improvements, feel free to open an issue or contribute to the project.
This project is licensed under the MIT License. See the LICENSE file for details.
GitHub: coderhyh
For more information and updates, visit the unplugin-auto-export GitHub repository.
| Back | FazBrowse Home | New Git URL |