Wordpress Starter Theme using Vite as bundler
# Watch assets
npm run watch
# Build assets for production
npm run prod
More tasks
# Watch images
npm run watch:images
# Run vite serve
npm run watch:vite
# Optimize images
npm run prod:images
# Run vite build
npm run prod:vite
# Zip theme
npm run zip
π₯ Hot Module Replacement
π¦ Serve only the JS and CSS used per page
π Optimize images
π© Convert theme images to .webp
π PostCSS w/ nesting and imports
π Remove WP scripts and emoji tags
π₯ THEMEPATH and AJAX_URL variables
π¬ Classic Wordpress theme structure (no weird stuff)
How to add a new page script?
Create a .js file in src/js, then enqueue it conditionally in functions.php using the wv_load_script(JS_NAME) functionHow does the image optimization works?
While in watching mode, every image you put into "src/img" folder gets an optimized version in "assets/img" also a WEBP version is created, you can add it in the theme by using the wv_img PHP functionHow does url() works in css
CSS urls points to assets folderwordvite/
βββ assets/ // public assets (like fonts) and output of processed assets
β βββ img/ // output of optimized images
β βββ js/ // output of builded vite files (js and css)
βββ core/
β βββ wordvite.php // contains wordvite useful php functions
βββ src/
β βββ css/ // style files
β βββ img/ // theme images
β βββ js/ // javascript files