Uncaught ReferenceError: require is not defined in custom app

when i try to load quill mention cdn ,i am getting this error require is not defined in custom app

$.getScript(“https://cdn.jsdelivr.net/npm/quill-mentions@0.2.4/src/js/mentions.min.js”,
});

can not import also

please guide the correct procedure to import package in custom app

Based on this environment setup code

https://github.com/frappe/bench/blob/develop/bench/utils.py#L604

My guess is to focus on how this applies in your particular case apps/your_custom_app/package.json

These two apps/frappe/package.json and apps/erpnext/package.son will give you clues too.

Perhaps this tutorial example will help Creating a Package | Yarn

edit: This could be a clue or tip How to import a .js module in Frappe?

and also this How to add a node module to a custom app?