https://github.com/themeplate/vite
Straight-forward Vite integration
https://github.com/themeplate/vite
Last synced: 5 months ago
JSON representation
Straight-forward Vite integration
- Host: GitHub
- URL: https://github.com/themeplate/vite
- Owner: ThemePlate
- License: gpl-3.0
- Created: 2023-01-20T02:52:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-24T12:34:15.000Z (almost 2 years ago)
- Last Synced: 2025-01-29T05:04:36.313Z (over 1 year ago)
- Language: PHP
- Homepage: https://www.npmjs.com/package/vite-plugin-themeplate
- Size: 113 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ThemePlate Vite
## Usage
`composer require themeplate/vite`
### functions.php
```php
use ThemePlate\Vite\Project;
$vite = new Project( get_stylesheet_directory(), get_stylesheet_directory_uri() );
// $vite->config->prefix( 'custom-' );
add_action( 'wp_enqueue_scripts', function() use ( $vite ) {
$vite->style( 'main-style' );
$vite->script( 'main-script' );
$vite->action();
} );
add_action( 'enqueue_block_editor_assets', function() use ( $vite ) {
$vite->style( 'editor-style' );
$vite->script( 'editor-script' );
$vite->action();
} );
```