Is it possible to create a plugin that can be initialized both using jQuery and vanilla Javascript like for example:
// jQuery
$("#selector").plugin({
option1: "val1",
option2: "val2"
});
// Javascript
var plugin = plugin("#selector", {
option1: "val1",
option2: "val2"
});
But also making sure it can be used via ES6 or CommonJS modules with import plugin from 'plugin.js'
or var plugin = require('plugin.js')