All of our products
does notcontain any jQuery within the core components. However, there are still some plugins that requires it, such as Select2 (and others), which is the main reason for jQuery's inclusion.
To check if a plugin requires jQuery, please refer to the plugin's official documentation and look for any indication of jQuery.
A quick hint to detect jQuery is, if the plugin syntax includes
$(...), then it's a high possibility that the plugin requires jQuery
Here's a quick 3 step how-to to completely remove jQuery from Metronic.
Remove jQuery
Locate the
package.jsonfile within the tools folder:
/theme/html/tools/
Find
jQuerywithin the list of
dependencies
Delete
jQueryfrom the list
Locate all plugins within the list of
dependenciesthat requires jQuery to run
For example: Select2 requires jQuery
Note: To check if a plugin requires jQuery, please refer to the plugin's official documentation and look for any indication of jQuery. Usually if the plugin syntax includes
$(...), it's a high possibility that the plugin requires jQuery
Delete all jQuery plugins from the list and re-run
yarn
Gulp Config
Locate the gulp config file within the tools folder:
/theme/html/tools/gulp.config.js
Find
jQuerywithin the list of
mandatoryplugins
Delete the entire
jQueryobject from the list
Locate all plugins within the
gulp.config.jsfile that requires jQuery to run
For example: Select2 requires jQuery
Note: To check if a plugin requires jQuery, please refer to the plugin's official documentation and look for any indication of jQuery. Usually if the plugin syntax includes
$(...), it's a high possibility that the plugin requires jQuery
Delete the entire plugin object from the list and re-run
gulp
Webpack Config
Locate the webpack config file within the tools folder:
/theme/html/tools/webpack/plugins/plugins.js
Find
jQuerywithin the list of
mandatoryplugins
Delete the entire
jQueryvariable from the file
Locate all plugins within the
plugins.jsfile that requires jQuery to run
For example: Select2 requires jQuery
Note: To check if a plugin requires jQuery, please refer to the plugin's official documentation and look for any indication of jQuery. Usually if the plugin syntax includes
$(...), it's a high possibility that the plugin requires jQuery
Delete the entire plugin object from the list and re-run
npm run build