This is a boilerplate for integrating React with Typescript into Wordpress
Go to file Use this template
2024-03-29 01:32:51 +01:00
wp chore(): Apply code formatting 2024-03-29 01:31:35 +01:00
.dockerignore chore(): Init from repo https://github.com/SerhiiChoBlog/wordpress-react/tree/master with some customizations 2024-02-16 13:26:45 +01:00
.gitignore chore(): Init from repo https://github.com/SerhiiChoBlog/wordpress-react/tree/master with some customizations 2024-02-16 13:26:45 +01:00
clean.sh chore(): Modify README.md, cleanup script and package.json to reflect the doc 2024-02-16 14:17:31 +01:00
docker-compose.yml chore(): Init from repo https://github.com/SerhiiChoBlog/wordpress-react/tree/master with some customizations 2024-02-16 13:26:45 +01:00
README.md feat(): Replace laravel-mix with rollup bundler 2024-02-18 12:44:30 +01:00
shell.nix feat(): Replace laravel-mix with rollup bundler 2024-02-18 12:44:30 +01:00

Setting up a WordPress plugin with React and TypeScript

Link to the article "Setting up a WordPress plugin with React and TypeScript "

How to start

If you use the Nix package manager, just type in nix-shell. Otherwise make sure that you have the following dependencies installed:

  • Docker
  • NodeJS >=18
  • NPM (if you don't want to use the included YARN 4.0.2)
  • PHP >=8.2 with composer

After that you can initialize the project:

cd wp/src/wp-content/plugins/wp-dynamic-form
yarn install
yarn compose
yarn build

Now you need to fire up the docker containers in the project root:

docker compose build
docker compose up -d --force-recreate

To clean up everything what was created by Wordpress, stop the docker containers and run the cleanup script:

docker compose down
./clean.sh