Skip to content
/ wordvite Public template

🍦 Wordpress Starter Theme using Vite as bundler

Notifications You must be signed in to change notification settings

EnzoEmb/wordvite

Repository files navigation

wordvite

Wordpress Starter Theme using Vite as bundler

Tasks

# 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

Features

πŸ”₯ 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)

Guide

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) function
How 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 function
How does url() works in css CSS urls points to assets folder

Scaffolding

wordvite/
β”œβ”€β”€ 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

About

🍦 Wordpress Starter Theme using Vite as bundler

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published