Here’s how to upgrade an existing web client with the PureWeb SDK v4.0.0.
(For newer versions, simply update the SDK version number below.)

  1. In a command prompt window, install the latest template into a new location on your system (you can target the desired version of the SDK when installing the new template)
    npx create-react-app new-client --template @pureweb/cra-template-pureweb-client@4.0.0
  2. From the new template client’s package.json, copy the dependencies and replace the existing client’s package.json dependencies section.
  3. Do the same with other sections including 'scripts' from the new template’s package.json file
  4. Copy and paste the contents of the tsconfig.json from the new template.
  5. Copy the config-overrides.js file from the new template and paste it into the same folder as the package.json in your existing client.
  6. Delete polyfills.ts
  7. Remove the node-modules folder from your existing client’s root folder.
    Note: You may have to adjust the properties of this folder to not be “Read-Only” prior to attempting deletion.
  8. In a command prompt window, clean your cache
    npm cache clean --force
  9. Run npm install or yarn install
  10. Test if it’s working by running npm start

NOTE: you may have to fix some errors in your code for it to compile but that should be straightforward, depending on the complexity of your customizations and/or other packages dependencies you’ve added to your custom web client.