Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

Testing JavaScript In And Around WordPress: Part 2 Example Code

Development Quick Start

  • Git clone:
    • git clone git@github.com:shelob9/testing-react-wordpress.git
  • Install.
    • yarn
  • Build JS/CSS
    • yarn build
  • Start JS/CSS for development
    • yarn start
  • Test changed files
    • yarn test --watch
  • Test all files once
    • yarn test
    • yarn test --ci
  • Create an installable zip file of your plugin.
    • yarn zip

To Add A New Entry Point

If you want to add additional entry points, for example if you want to add blocks or to have separate JavaScript/ CSS for the front-end, follow these steps:

  • Choose a one word handle for the entry point
  • Create a directory named for the handle.
  • Add an index.js file to that directory
  • Add the handle to the array entryPoints in webpack.config.js
  • Run yarn build
  • Check that build/$handle.js and build/$handle.asset.php where created.

Local Development

Contributing

Please feel free to open a pull request if you would like to contribute.

About

Example code for part 2 of my talk "JavaScript Testing In And Around WordPress"

Resources

Releases

No releases published

Packages

No packages published