The plugins option is an array of plugin definitions. Calling a plugin with the parameter deferInit: true will stop it from automatically initialising – you can do that at a later time with wavesurfer.initPlugin('mypluginname').
The CursorCustomPlugin is a plugin that extends the basic CursorPlugin,
so you can override some methods with your custom features, maintaining the existing functionalities
and the library support.
Adding type=module on the script element of your js script, allows the browser to treat
the script as an ECMAScript module, so you can use import statements to import the CursorCustomPlugin.
<script type="module" src="app.js"></script>If you are using a framework instead, you should modify your
babel configs, adding this configuration
presets: [
[
'@babel/preset-env',
{
"targets": {
"esmodules": true
}
}
]
],