vite-plugin-online-debug
v0.0.2
Published
debug with online environment
Downloads
0
Readme
Vite Plugin Template
A template for creating Vite plugins with TypeScript, testing, and publishing setup.
Features
- 📦 TypeScript support with type definitions
- 🧪 Testing with Vitest
- 📦 Dual CJS/ESM build with tsup
- 🔍 ESLint configuration
- 📚 Ready for npm publishing
- 🎯 Example plugin implementation
Usage
Installation
npm install vite-plugin-templateBasic Usage
// vite.config.ts
import { defineConfig } from 'vite'
import templatePlugin from 'vite-plugin-template'
export default defineConfig({
plugins: [
templatePlugin({
example: true
})
]
})Development
Setup
# Clone this template
git clone https://github.com/yourusername/vite-plugin-template.git
cd vite-plugin-template
# Install dependencies
npm install
# Start development
npm run devScripts
npm run dev- Build in watch modenpm run build- Build the pluginnpm run test- Run testsnpm run test:ui- Run tests with UInpm run lint- Run ESLintnpm run lint:fix- Fix ESLint issuesnpm run prepublishOnly- Build and test before publishing
Publishing to npm
- Update
package.jsonwith your plugin details - Update the repository URL in
package.json - Run
npm run build && npm test - Publish with
npm publish
Plugin Development
Your plugin's main logic goes in src/index.ts. The template includes:
- Plugin options interface
- Basic plugin structure with common hooks
- Example transformation logic
- Type safety with TypeScript
Testing
Write your tests in the tests/ directory. The template includes example tests that demonstrate:
- Plugin creation
- Option handling
- Transformation logic
License
MIT
