4

我的 Visual Studio 2013 应用程序使用 LESS,它是使用 BundleTransformer ( http://bundletransformer.codeplex.com ) 捆绑的。LESS 文件跨整个应用程序导入到单个 app.less 中。然后捆绑此 app.less 文件。

// Bundles
using BundleTransformer.Less;
...
var cssBundle = new Bundle("~/bundles/less");
cssBundle.Include("~/content/less/app.less");

使用这种方法,Chrome(以及其他所有浏览器)只能看到最终的 app.less。当我打开 Chrome 开发者工具并即时更改 CSS 时,Browser Link 会自动将更改保存回 app.less。原来的 app.less 看起来像下面这样,现在是浏览器加载的整个编译版本。

// app.less
@import "bootstrap/bootstrap.less";
@import "app/common/layout/header.less";
@import "app/common/layout/footer.less";

1) How do I prevent Browser Link from automatically saving? I've turned off the "Enable F12 Save Changes" option, but it doesn't care. Or disable saving of LESS files only, as I do modify Javascript in Chrome Developer tools often and wish to save.

2)如果我确实想保存(我这样做),有没有办法配置我的应用程序、BundleTransformer 和/或我的浏览器(Chrome)以映射到原始源文件(在开发期间),而不是编译的应用程序。较少的?

我也在使用 Web Essentials 2013 (1.8.5),但只是为了在 VS 中查看 LESS。

Chrome 已映射到我的应用程序工作区。https://developers.google.com/chrome-developer-tools/docs/settings#workspace

4

1 回答 1

2

Disable VS BrowserLink

  <appSettings>
   <add key="vs:EnableBrowserLink" value="false"/>
</appSettings>
于 2014-11-05T16:00:13.563 回答