nucab / react-clear-cache

MIT License
67 stars 48 forks source link

Can't get it to work in ASP.NET Core CRA w/ ServiceBroker #59

Open ryanpeters74 opened 3 years ago

ryanpeters74 commented 3 years ago

Using the ASP.NET Core CRA application that leverages a ServiceBroker, the package does not work. https://docs.microsoft.com/en-us/aspnet/core/client-side/spa/react?view=aspnetcore-5.0&tabs=visual-studio

madestroIT commented 2 years ago

Using the ASP.NET Core CRA application that leverages a ServiceBroker, the package does not work. https://docs.microsoft.com/en-us/aspnet/core/client-side/spa/react?view=aspnetcore-5.0&tabs=visual-studio

I was able to get this running after a few hours of trial and error. In short, you are better off modifying your project file and adding a command that executes the versioning script:

<Target Name="UpdateClientAppVersion" BeforeTargets="Build"> <Exec WorkingDirectory="$(SpaRoot)" Command="node ./node_modules/react-clear-cache/bin/cli.js" ContinueOnError="false"/> </Target>

This will ensure the meta.json file is generated any time you build.