简体   繁体   中英

Managing 3rd party JavaScript libraries in WebStorm under source control

I am a newbie in WebStorm. I created a TypeScript project (empty project with enabled TypeScript transpiler) and added index.html with links to my scripts.

I want to add 3rd party JavaScript libraries with TypeScript declaration files (jQuery, Knockout, Snap.svg, etc), but with next requirements:

  1. I don't want to add js libraries to my source control.
  2. I want to have my sources in the maximum "compilable" state (minimum manipulation after git checkout).
  3. Local sources (in project/external or project/libraries folder) - not all libraries have CDN.

In my fantasy it's works like a Nuget works with dll packages in Visual Studio.

You could use bower or npm .

They are package managers and you can use it regardless of your IDE. Adding and removing a third party library is dead easy by adding/removing a line in bower.json / package.json for bower / npm respectively.

Here's two links which could help you to learn bower. https://css-tricks.com/whats-great-bower/ https://www.codementor.io/bower/tutorial/beginner-tutorial-getting-started-bower-package-manager

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