Updated How to set up WooCommerce development environment (markdown)

Roy Ho 2021-11-11 13:26:39 -08:00
parent df50d71060
commit 91612b9fbf
1 changed files with 6 additions and 4 deletions

@ -20,6 +20,8 @@ Before starting, make sure you have the following software installed and working
1. [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) to clone the WooCommerce repository (or your fork of the WooCommerce repository).
2. [NVM](https://github.com/nvm-sh/nvm) to install Node.js and NPM.
3. [Composer](https://getcomposer.org/download/) to install PHP packages required by WooCommerce such as the `woocommerce-rest-api` and the `jetpack-autoloader`. It's also necessary to use the PHP CodeSniffer that ensures your code follows code standards.
4. Follow [instructions on nx.dev site](https://nx.dev/l/r/getting-started/nx-setup) to install Nx.
5. Follow [instructions on pnpm.io site](https://pnpm.io/installation) to install pnpm.
## Configure a local WordPress instance
@ -64,14 +66,14 @@ To install WooCommerce dependencies (this includes some functionality such as Gu
$ cd ~/vagrant-local/www/wordpress-one/public_html/wp-content/plugins/woocommerce
$ nvm install
$ nvm use
$ npm install
$ composer install
$ pnpm install
$ pnpm nx composer-install woocommerce
```
The source code found on GitHub does not contain compiled CSS or Javascript. To generate those assets run the following command from the WooCommerce root directory:
```
npm run build
pnpm nx build woocommerce
```
_Note: Depending on your PHP settings, you may encounter an out-of-memory error similar to the following..._
@ -88,7 +90,7 @@ _If this happens, increase the `memory_limit` setting in your php.ini configurat
To automatically rebuild the assets whenever a JS or SCSS file is modified run:
```
npm run build-watch
pnpm nx build-watch woocommerce
```
## IDE integrations