简体   繁体   中英

How do I expose my javascript library for other clients to use?

I'm using Vert.x and Angular and I have a javascript library that I would like to allow other people to leverage in their code client-side code. How can I enable them to do something like:

<script src="cdn.myServer/myLib.js"></script>

Basically I want to do the same as google does with ajax.googleapis.com for my js library on my server.

除了CDN,您还可以制作npmbower软件包,其他开发人员可以在模块存储库中找到它们。

You can use BOWER or NPM to publish your library. So others can include it in their apps by bowr/npm install. Another way is putting it in github and serve it as static file with rawgit.com.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM