How to include js files in a Visual Studio project on build

1.7k views Asked by At

In our project there are some front-end developers that use a different IDE from VS to write JS, CSS and HTML templates. However our build process does not include the files in their appropriate folders, but only the ones that are specified in the .csproj files.

Front-end developers should be able to edit their files in the separate IDEs and before they commit to source control they would build the VS Solution once. I want their files to be included in the .csproj file of the project on build.

1

There are 1 answers

0
Sandre On

You can include files to project by mask, so front-end developers can build solution with these files from command line.

For example:

<ItemGroup>
    <Content Include="..\..\Client\*.css">
        <Link>%(Filename)%(Extension)</Link>
        <!-- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> -->
    </Content>
    <Content Include="..\..\..\..\Bin\Client\Drivers\**\*.*">
        <Link>Drivers\%(RecursiveDir)%(Filename)%(Extension)</Link>
        <!-- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> -->
    </Content>
</ItemGroup>