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.)
- 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 - From the new template client’s package.json, copy the dependencies and replace the existing client’s package.json dependencies section.
- Do the same with other sections including 'scripts' from the new template’s package.json file
- Copy and paste the contents of the tsconfig.json from the new template.
- 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.
- Delete polyfills.ts
- 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. - In a command prompt window, clean your cache
npm cache clean --force - Run npm install or yarn install
- 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.