kingdanie / brads-boilerplate-wordpress

An example starter theme and block-type plugin that use @wordpress/scripts for JS & CSS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Brad’s Boilerplate

This repo contains one folder that is an example theme, and another folder that is an example block-type plugin. Both folders use the official @wordpress/scripts package to power the JS(X) and SCSS bundling.

This repo is part of one of my YouTube videos, check it out for a more detailed walkthrough.

After placing one of the folders in your WordPress themes or plugins folders, you then:

  1. Point your terminal towards the new example folder.
  2. Run npm install
  3. Run npm run start and the package will now be watching for any saved changes to your JS or SCSS files.

Alternatively, you can run npm run preview and that will both start the watch task and start a proxy server running on localhost:3000 that will automatically refresh the browser anytime you save a change. In order for this feature to work you will need to change the domain in package.json on line #8. In my file it mentions myexample.local but obviously you will have a different local dev domain that you want to proxy.

Enjoy!

About

An example starter theme and block-type plugin that use @wordpress/scripts for JS & CSS

License:MIT License


Languages

Language:PHP 45.5%Language:JavaScript 41.1%Language:SCSS 8.4%Language:CSS 5.1%