I want to validate an assumption about overriding a single JS file chunk from plone.staticresources, based on things I've pieced together from a few different threads here — maybe someone has either done this already, or knows if I'm playing with fire here (e.g. filename instability).
To avoid maintaining a private fork of plone.staticresources:
I want to consider deploying a customization of the pat-tinymce link modal in an add-on as a single resource file override (via zc3.jbot >= 1.1.0 resource override)
with the single resource here (plone.staticresources master branch) being static/bundle-plone/chunks/tinymce_plugins.6f290aa6d2213b2ee16d.min.js having its equivalent chunk asset (different filename, but easy enough to see in via git status after build) to an overrides/resources directory in my policy product with a filename of plone.staticresources.static.bundle-plone.chunks.tinymce_plugins.6f290aa6d2213b2ee16d.min.js (well, this and probably the chunk containing related CSS embedded in JavaScript).
I have already built my changes against mockup and its usual webpack processes, and I'm satisfied with what I have put together, but want a reasonable way to narrowly package just my cutomization/override into my policy package.
Is this reasonable? Are there any other pitfalls I might encounter besides moving target of chunk/resource filename between Plone releases?
I'm also interested in that. As went the fork way and created an internal release of plone.staticresources with our mockup changes, but we would love to know if there are easier days to do this
create a customer.staticresource addon package with webpack.config, JS resources and a GS profile (for later resource registry entry)
add @plone/mockup as dependency in your package.json
copy only the pattern code which you want to customize into your custom package resource folder (src/pat/tinymce for example)
create your own src/patterns.js file with all the default patterns (see mockup/src/patterns.js at master · plone/mockup · GitHub ... use @plone/mockup/src/pat/autotoc/autotoc for default pattern import) but change the path of your locally customized pattern
build the whole stack
now unregister the plone bundle and register your customer bundle in RR
with this, you could also easily update mockup version if there is a new release while keeping your customizations in place...
NOTE 2: I've now also added an example, how to customize the SelectedItem.svelte component (for example if you want to customize the look and feel of selected items in relatedItems field)