Beginner question regarding webpack/er environment.js and application.js For importing a JS library like jQuery, Popper etc. I am using a webpack provide plugin in environment.js
// environment.js
const webpack = require("webpack");
environment.plugins.append("Provide", new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
Popper: ['popper.js', 'default']
}));
This makes jQuery and Popper available to Bootstrap and any JS code I write. But if I am using select2 it to the list of plugins does not work. I have to import it in my application.js
//application.js
import select2;
If I want use Quilljs I have to import it (a bit differently though) in my application.js
import Quill from 'quill';
What is the difference between importing a library vs adding a library as a plugin. I have done quite a bit of Googling but cannot find a resource that explains these concepts. Can someone explain this or point me to a resorce.