SCSS文件未在Visual Studio中的解决方案资源管理器中分组

时间:2015-12-03 17:44:05

标签: css visual-studio visual-studio-2013 web-essentials

我使用的是Visual Studio 2013。

在解决方案资源管理器中,scss文件通常将.css,.css.map,.min.css文件组合在.scss文件下的树中。但是,我的解决方案资源管理器会单独显示它们,这会导致一些混乱。

任何人都可以帮助我,让我知道将这些文件再次组合在一起的快捷方式/技巧吗?

1 个答案:

答案 0 :(得分:4)

手动编辑项目文件或使用这个漂亮的Visual Studio扩展:

enter image description here

手动技巧是编辑项目文件并将DependentUpon元数据添加到要嵌套的每个文件中:

<ItemGroup>

    <!-- This will cause Visual Studio to show the file under Foo.1.cs -->
    <Compile Include="Foo.1.1.cs">
      <DependentUpon>Foo.1.cs</DependentUpon>
    </Compile>

    <!-- This will cause Visual Studio to show the file under Foo.cs -->
    <Compile Include="Foo.1.cs">
      <DependentUpon>Foo.cs</DependentUpon>
    </Compile>
    <Compile Include="Foo.cs" />
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>

来源: