S
S
startproger2021-12-23 22:21:29
JavaScript
startproger, 2021-12-23 22:21:29

Do I need to use define.amd in jQuery code when using Vue 3?

There is such a construction that is found in almost any jQuery plugin:

if (typeof define === 'function' && define.amd) {
    define(['exports'], factory(exports));
} else if (typeof module === 'object' && module.exports) {
    factory(module.exports);
} else {
    factory(exports);
}


I'm using Vue.js at the moment, but for good measure, jQuery plugins are also used here and there, including custom ones.

I understand that it should be abandoned altogether, but if not abandoned, but used like this in conjunction with Vue 3, is it necessary to continue writing this code at the beginning of each jQuery plugin or is it unnecessary? In general, it works without it ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-12-23
@Rsa97

https://habr.com/ru/post/501198/#4
AMD - Asynchronous Module Definition

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question