![](/img/trans.png)
[英]How to get the ASP.NET MVC bundle manager to render a script tag with the type = “module” attribute?
[英]How to bundle the JS loaded by script manager from CDN in Asp.Net
ScriptBundle
僅允許包含與應用程序相關的URL(〜/ url),僅在頂級軟件包級別支持在軟件包中使用CDN。
您可以自己構建,也可以像https://ajax.aspnetcdn.com/ajax/4.6/1/MsAjaxJs.js
那樣將整個捆綁包上傳到CDN。
bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs", "https://ajax.aspnetcdn.com/ajax/4.6/1/MsAjaxJs.js").Include(
"~/Scripts/WebForms/MsAjax/MicrosoftAjax.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"));
此外,在web.config
文件中將編譯設置為false
時,也會啟用優化
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.