简体   繁体   中英

Reference javascript files to use visual studio 2010 intellisense

I have a website with very heavy (long javascript > 100KB + JQuery). So, for making the javascript re-useable, I want to separate the logic in different javascript files.

So, I want to make an aggregated javascript file

在此处输入图片说明

Please tell me how (I even want to use the VS2010 intellisense in my main JS file about the functions of the other JS files.)

Javascript Intellisense tends to be extremely unreliable as some updates broke it some updates fixed it, and there are a lot of extensions around it, breaking each other.

Still there is a /// <reference> element for cases like this.

See MSDN article and add line:

/// <reference path="otherscript.js" />

at the top of your script file.

Try to test it with the jQuery vsdoc and your other script files.

Also installing MVC4 installed some dependency or whatever that more-or-less fixed javascript intellisense for me.

我会推荐Resharper: http : //www.jetbrains.com/resharper/whatsnew/

You can separate your Javascript files and use SquishIt to concatinate and compress/minify them all into one single file to reduce the file size and the number of requests.

I don´t know of any solution that allows you to work in both the concatinated file as well as each separated file ...and I don´t understand why anyone would want to.

IMO, Visual Studio has a quite poor intellisense for Javascript.

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