Open Closed

Hot reload does not work in Abp Module #3180


User avatar
0
developer_infoline created

Hi,

When I make changes to js and html files in the abp module, I have to close and reopen the project to see the change.

Abp application projects work fine but is a separate configuration required for the module?

  • ABP Framework version: v5.2.1
  • UI type: MVC /
  • DB provider: EF Core / PostgreSql
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

4 Answer(s)
  • User Avatar
    0
    developer_infoline created

    Problem solved with EnableRazorRuntimeCompilationOnDevelopment

  • User Avatar
    0
    developer_infoline created

    Hi,

    This code only allows me to edit the html page.

    Changes in my js and css files are not reflected on the screen without re-build.

    How do i solve this?

  • User Avatar
    1
    enisn created
    Support Team .NET Developer

    Hi @developer_infoline

    Have you tried to run your project with dotnet watch run. The watch should watch changes on the rest of the files like css too.

    https://docs.microsoft.com/en-us/aspnet/core/tutorials/dotnet-watch?view=aspnetcore-6.0#run-net-core-cli-commands-using-dotnet-watch

    dotnet watch refreshes the browser when it detects changes to watched files. To do this, the watch command injects a middleware to the app that modifies HTML responses created by the app. The middleware adds a JavaScript script block to the page that allows dotnet watch to instruct the browser to refresh. Currently, changes to all watched files, including static content such as .html and .css files cause the app to be rebuilt.

  • User Avatar
    1
    enisn created
    Support Team .NET Developer

    But you should customize files to watch in .csproj file for including js files according to Microsoft's docs: Customize files list to watch

    <ItemGroup>
        <!-- extends watching group to include *.js files -->
        <Watch Include="**\*.js" Exclude="node_modules\**\*;**\*.js.map;obj\**\*;bin\**\*" />
    </ItemGroup>
    
Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07