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!
assets/js/ctct-plugin-admin- Contains all the original JavaScript for the admin area.assets/js/ctct-plugin-frontend- Contains all original JavaScript for the frontend.src- Contains all related block JavaScript. Note that both theblockandadminJS only load on new page/post pages in the admin.
- Edit
plugin-config.jsto match your local environment.localURL- this should match your local development URL.watchURL- should either behttps://localhost:3000orhttp://localhost:3000depending 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:3000to 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 /src/ assets.npm run styles- will compile and compress assets/sass source file into the resulting css and minified css.npm run styles:compile- will compile assets/sass source file into the resulting unminified cssnpm run styles:compress- will compress the resulting css from the compile script.npm run stylesadmin- will compile and compress admin assets/sass source file into the resulting css and minified css.npm run stylesadmin:compile- will compile admin assets/sass source file into the resulting unminified cssnpm run stylesadmin:compress- will compress the resulting admin css from the compile script.
- 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