Maybe the title is not very clear, I will explain in detail:
I rely on a jq component in a project. It is referenced through a script tag. How can I make it available through the import method?
https://www.npmjs.com/package/particles.js
This is the library above. I changed the part where I forgot to hang a function on the window to export default. I found that an error will be reported. How can I modify this so that I can use import?
window.particlesJS.load = function(tag_id, path_config_json, callback){
code ...
}
//这里我加了
export defalut particlesJS;
I found that it is not possible. What did I do wrong?
Install into node_module
Quote (in entry file)
If this jq component needs to call jq methods or use jq objects, jq must also be installed and exposed to the world
Exposed to the overall situation, I use webpack here, and the rest is up to you - -