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.js
file to the component directory containing the JavaScript you want to use. - Add the file to the
rollup.index.js
file 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
npm run build
from the core package directory manually to update thedist.js
file with your new script.