ahmadawais / create-guten-block

📦 A zero-configuration #0CJS developer toolkit for building WordPress Gutenberg block plugins.
https://Awais.dev/cgb-post
MIT License
3.15k stars 328 forks source link

Why is there no js script for frontend+backend? #273

Open pwkip opened 4 years ago

pwkip commented 4 years ago

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 4 years ago

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?

bfiessinger commented 3 years ago

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

doodirock commented 2 years ago

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