anthonychu / GruntBundling

Use grunt for bundling instead of System.Web.Optimization in ASP.NET
5 stars 3 forks source link

Publishing the project with hashed files. #1

Open DanielBadan opened 7 years ago

DanielBadan commented 7 years ago

Hi here, thank you for this awesome example.

Working with Visual Studio, you can't include the hashed assets manually from Solution Explorer as you'll need to do this every time an asset changes. Without that, assets don't get on dev and prod environments as they're not included in the project.

Is there a way to include them dynamically?

praga commented 7 years ago

I am having similar issue, please do let me know if you find a solution

DanielBadan commented 7 years ago

Found one, you have to use a wildcard in your .csproj file.

https://msdn.microsoft.com/en-us/library/ms171454(VS.80).aspx http://stackoverflow.com/questions/2059562/in-visual-studio-how-can-i-set-the-build-action-for-an-entire-folder

I'm using this to include all folders and files from ./Build folder

<Target Name="BeforeBuild">
  <ItemGroup>
     <Content Include="Build\**\*.*">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
   </ItemGroup>
</Target>
praga commented 7 years ago

Thanks alot for the quick response, Ill give this a go next week.

praga commented 7 years ago

It worked perfectly, Thanks again