A Vite plugin for ModulesPress framework that enables modern frontend development in WordPress plugins.
- TypeScript and React support out of the box
- SCSS processing with modern API
- Hot Module Replacement (HMR) for PHP files
- Asset manifest generation
- Optimized build output structure
npm install @modulespress/vite-plugin --save-dev
// vite.config.ts
import { defineConfig } from 'vite'
import { ModulesPressVitePlugin } from '@modulespress/vite-plugin'
export default defineConfig({
plugins: [
ModulesPressVitePlugin({
// options
})
]
})
Option | Type | Default | Description |
---|---|---|---|
inputPatterns |
string[] |
['./**/*.(script.ts|script.tsx)', './**/*.style.scss'] |
Glob patterns for entry files |
pluginRootDir |
string |
'./' |
Root directory of your plugin |
scssOptions |
Record<string, any> |
{ api: 'modern-compiler' } |
SCSS compiler options |
refreshExtensions |
string[] | false |
['.php'] |
File extensions that trigger full page reload |
- Node.js 14.x or higher
- Vite 5.x
- TypeScript (for TypeScript usage)
MIT License - see LICENSE file for details
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Clone the repository
- Install dependencies:
npm install
- Make your changes
- Build the plugin:
npm run build
- Test your changes
- Follow the existing code style
- Write clear commit messages
- Add tests if applicable
- Update documentation as needed
For major changes, please open an issue first to discuss what you would like to change.