Basic JavaScript enhancements
"Vanilla" JavaScript can be used selectively to provide client-side enhancements to Comet Components.
Create a JavaScript-enhanced Comet Component
- Create a new component as you would for a standard PHP component.
- Add a
your-component.jsfile to the component directory containing the JavaScript you want to use. - Add the file to the
rollup.index.jsfile in the core package root directory. This will ensure that the file is included in the bundled JavaScript file that implementations can use. - If you don't have a file watcher or other automatic way for Rollup to run configured, run
pnpm run buildfrom the core package directory manually to update thedist.jsfile with your new script.
