create-guten-block icon indicating copy to clipboard operation
create-guten-block copied to clipboard

Why is there no js script for frontend+backend?

Open pwkip opened this issue 4 years ago • 3 comments

I was just wondering why there is no script.js file for frontend+backend

The current block assets are:

 * 1. blocks.style.build.css - Frontend + Backend.
 * 2. blocks.build.js - Backend.
 * 3. blocks.editor.build.css - Backend.

Why is this missing the (seemingly) obvious 4th option? * 4. blocks.script.build.js - Frontend + Backend.

pwkip avatar Mar 23 '20 21:03 pwkip

So I've been trying to implement this myself in a fork, and would like to create a pull request.

I'm just wondering how I can test if my changes work.

I have made some changes in the packages/cgb-scripts/template/src folder. But after I execute the following commands:

git clone [email protected]:pwkip/create-guten-block.git
cd create-guten-block
yarn
yarn create-guten-block demo-block

I do not see my changes reflected in the demo-block/src folder.

What can I do in order to generate a demo-block based on my own local cgb-scripts code?

pwkip avatar Mar 24 '20 23:03 pwkip

@ahmadawais it would be great if there was a configuration file to modify the default webpack config or at least to add your own stylesheets and scripts for bundling.

bfiessinger avatar Jul 21 '20 14:07 bfiessinger

Would really love something like this for blocks that require dynamic JS on the frontend for things like modals, AJAX, form validation etc

doodirock avatar Sep 17 '21 15:09 doodirock