10up / 10up-toolkit

Official 10up asset building toolkit.
114 stars 19 forks source link

RFC: Add new `moduleEntry` key to package.json to allow for manual addition of module scripts #386

Closed fabiankaegy closed 6 months ago

fabiankaegy commented 7 months ago

In #372 we added support for JS modules to be loaded via block.json using the viewScriptModule & scriptModule keys. However since doing that I often ran into the need to actually add additional module scripts for extend some core functionality that isn't tied to a custom block we are developing.

So we need some way to also add some additional JS modules that are not added as entry points via a block.json file. Because of that I think it would be good to add a new moduleEntry key to the tenup toolkit config in package.json which would allow anyone to add additional module scriots.

fabiankaegy commented 7 months ago

@nicholasio I would love to get your take on this before I go ahead and implement it 👍

nicholasio commented 7 months ago

I think this makes sense - specially considering that the modules stuff per see isn't tied to the interactivity api and that the interactivity api itself is not technically tied to blocks.

👍