vite-plugin-combine
TypeScript icon, indicating that this package has built-in type declarations

6.2.1 • Public • Published

vite-plugin-combine

npm package

NPM version NPM Downloads Node version

Combines multiple module files into a single target file. It supports four modes: named exports, default exports, automatic exports, and no exports, and can auto-generate corresponding import statements based on configuration.

import { defineConfig } from 'vite';
import combine from 'vite-plugin-combine';

export default defineConfig({
  plugins: [
    combine({
      src: 'src/*.ts', // 匹配要组合的文件路径
      target: 'src/index.ts', // 目标文件路径
      exports: 'named', // 导出类型:'named' | 'default' | 'both' | 'none'
    })
  ],
  build: {
    minify: false,
    lib: {
      formats: ['es', 'cjs'],
      fileName: '[name]'
    }
  }
});

Documentation

For detailed usage instructions and API references, please visit the official documentation:

👉 View Full Documentation

Contributing

We welcome contributions from the community! If you find a bug or want to suggest an improvement, feel free to open an issue or submit a pull request.

How to Contribute

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Submit a pull request with a clear description of your changes.

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i vite-plugin-combine

Weekly Downloads

17

Version

6.2.1

License

MIT

Unpacked Size

18.5 kB

Total Files

9

Last publish

Collaborators

  • fengxinming