DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

How to do a 'react' build?

Sort:
You are not authorized to post a reply.








    I want to debug an issue in the client side react code , How do I do a build so that my changes are transferred to my dev website? That is without doing ".\Build.ps1 -Target ResetDevSite"

    Must be something simpler...






    New Around Here





      It isn't unfortunately. So first thing to understand: the React code doesn't live in VS when you open the solution. VS is not the best tool for editing React javascript. VS Code, for instance, is much better. So open up your Git cloned DNN folder in VS Code and go to the Admin Experience folder and then ClientSide. That holds all the React code for the PersonaBar. Navigate to the react project of your choice, for instance the Site Settings (SiteSettings.Web). Open the package.json and check the projects "name" (site_settings).

      Now also open a shell/command prompt at the root of the git repo. And type in this code:

      
      yarn watch --scope site_settings
      


      This will fire up webpack and build this project and copy the result to where you've specified in the settings.local.json. If you don't know what that means please read the BUILD document in the repo documentation.

      Peter








        Great, thanks, works as advertised.

        So webpack observes file changes, that is handy. Chrome complains that react hot module replacement is not available. I probably need a plugin Next I need to figure out how to do debugging...






        Senior Member





          Awesome discussion!  Also, it's maybe too amusing that Peter S. is labeled "new around here."  :) 

          See you at DNN Connect in a few months!  

          You are not authorized to post a reply.

          These Forums are dedicated to the discussion of DNN Platform.

          For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

          1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
          2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
          3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
          4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
          5. No Flaming or Trolling.
          6. No Profanity, Racism, or Prejudice.
          7. Site Moderators have the final word on approving / removing a thread or post or comment.
          8. English language posting only, please.

          Would you like to help us?

          Awesome! Simply post in the forums using the link below and we'll get you started.

          Get Involved