Hey Metronic Community!
I am working on integrating Webpack with the Metronic template and noticed that plugins can be added in two different ways:
What is Metronic’s best practice for deciding which plugins belong in importExtraPlugins() vs. webpack/plugins/custom/?
I want to ensure that I’m following the best approach for managing plugin bundling in Webpack while keeping performance optimized.
Thank you for your guidance!
Use webpack/plugins/custom/ and import plugins.js when: The plugin is used selectively and does not need to be included in the global package. This is a third-party JavaScript library (e.g. jQuery plugin, Bootstrap extension) that should be modular. You should only lazy load plugins when needed to optimize performance.
Hi Ivan Tamoni
Here's the recommended approach:
Will the plugin be used on most pages of application? If YES → Add to global bundle in plugins.js If NO → Add as custom plugin in resources/mix/vendors/