Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
485 views
in Technique[技术] by (71.8m points)

如何用webpack构建和使用自己的第三方JS库?

很好奇像jQueryReact这些打包好的库加载之后可以在全局中使用$,jQueryReact来访问,想知道自己构建的库如何做到可以在全局中像React这样可以在全局中使用。

我发现webpack打包之后在全局根本找不到定义的相关对象。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

打包成 library 即可,请详读 https://webpack.js.org/guides...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...