使用SquishIt合并js文件没有效果?

发布于 12-08 21:22 字数 519 浏览 5 评论 0原文

@{
  ViewBag.Title = "Home Page";
  SquishIt.JavaScript.Add(
    Url.Content("~/Scripts/jquery_ui.js"),
    Url.Content("~/Scripts/jquery_1.4.4.js")
  );
}
@SquishIt.JavaScript.Render(Url.Content("~/Scripts/min.js"))

它显示如下:

<script type="text/javascript" src="/Scripts/jquery_ui.js"></script>`
<script type="text/javascript" src="/Scripts/jquery_1.4.4.js"></script>`

“min.js”在哪里?

这两个js文件不是合并成一个名为min.js的js吗?

谢谢!

@{
  ViewBag.Title = "Home Page";
  SquishIt.JavaScript.Add(
    Url.Content("~/Scripts/jquery_ui.js"),
    Url.Content("~/Scripts/jquery_1.4.4.js")
  );
}
@SquishIt.JavaScript.Render(Url.Content("~/Scripts/min.js"))

It shows like this:

<script type="text/javascript" src="/Scripts/jquery_ui.js"></script>`
<script type="text/javascript" src="/Scripts/jquery_1.4.4.js"></script>`

Where is "min.js"?

The two js files are not combine into one js named min.js?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

筱武穆2024-12-15 21:22:00

为了帮助调试,SquishIt 在调试模式下不会对文件执行任何操作。

但是,您可以在 .Render(...) 调用之前添加 .ForceRelease() 调用,以强制它合并文件,就像处于发布模式一样:

@SquishIt.JavaScript.ForceRelease().Render(Url.Content("~/Scripts/min.js"))

To help with debugging, SquishIt does not do anything to the files when in debug mode.

However, you can add a .ForceRelease() call before the .Render(...) call to force it to combine the files as if it's in release mode:

@SquishIt.JavaScript.ForceRelease().Render(Url.Content("~/Scripts/min.js"))
御弟哥哥2024-12-15 21:22:00

web.config 中有 debug="true" 吗?必须将其设置为“false”,squishit 才能工作: http://www.codethinked.com/squishit-the-friend-aspnet-javascript-and-css-squisher

Do you have debug="true" in web.config? It must be set to "false" for squishit to work: http://www.codethinked.com/squishit-the-friendly-aspnet-javascript-and-css-squisher

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文