Since we want to add in support for Gutenberg, webpack has been integrated into the workflow. It is now
responsible for transpiling and bundling all JavaScript files. You can also write JSX
out of the box!
ctct-plugin-admin
- Contains all the original JavaScript for the admin area.ctct-plugin-admin
- Contains all original JavaScript for the frontend.ctct-plugin-gutenberg
- Contains all related Gutenberg JavaScript. Note that both thegutenberg
andadmin
JS only load on new page/post pages in the admin.
- Edit
plugin-config.js
to match your local environment.localURL
- this should match your local development URL.watchURL
- should either behttps://localhost:3000
orhttp://localhost:3000
depending on whether you have SSL running or not.publicJS
- this is just the public JS path and should not need updated.
- Run
npm install
. - Run
npm run watch
. - Open up
localhost:3000
to vew the site.
NOTE: If you use Local by Flywheel and Browsersync seems to be really slow, you can go into
LBF->Preferences->Advanced menu and toggle on the IPv6 Loopback
option. This should speed things up.
Another Tip: If you make the LBF setting change above and your local site loads with just
It Works
on the page, just toggle the IPv6
option off.
npm run watch
- will watch all JS/SCSS files and reload when changed.npm run dev
- will build all CSS files plus non-minified JS files.npm run build
- will build all CSS files plus minified JS files.
- Download the repo.
- Run
composer install
- Check PHP compatibility with the Composer script
composer run compat
- Lint code with the Composer script
composer run lint