Code Monkey home page Code Monkey logo

vite-wordpress-starter-theme's Introduction

WordPress Vite.js starter theme

Under the hood

Requirements

Usage

First, clone this repository in your WordPress themes directory.

Then, run the following commands in the theme's directory :

npm install

Launch your watch for assets with :

npm run dev

For production sites, create your build with :

npm run build

Vite & WordPress

  • All the static assets used in scss or js files (images, fonts, etc.) are copied as-is to the dist directory. The other images used directly in php files are not copied.
  • To detect dev mode in php there is no dist directory, it is added on build.

Troubleshooting [dev mode]

  • Vite needs to know the root path of your project so you cannot use a subdirectory as the root of your WordPress installation.
  • If you haven't started the dev server, your assets will not be compiled just npm run dev and refresh page.
  • In your scss files use the alias @ to target the static/ directory. ie : background-image: url('@/img/logo.png');

vite-wordpress-starter-theme's People

Contributors

oguilleux avatar

Stargazers

Nicolas Gillium avatar Tibor Szabo avatar k. amoh avatar Micah avatar Demetris avatar Nejc avatar

Watchers

 avatar Nicolas Gillium avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.