ahmadawais/create-guten-block

Why is there no js script for frontend+backend?

pwkip opened this issue · 3 comments

pwkip commented

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 commented

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 git@github.com: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?

@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.

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