Since create-react-app has been deprecated, here a Vite template to scaffold Vite+React+Typescript+FluentUI Dataverse WebResources ready to use. The structure of the template is equal to the one used by @_neronotte/cra-template-dataverse-webresource.
If you don't have it already, install degit via:
npm install -g degitThen type:
npx degit neronotte/vite-template-dataverse-webresources#main <your-webresource-name>
cd <your-webresource-name>
npm installWhere <your-webresource-name> is the name of the webresource you want to create.
Once the template has been installed, move in the .\<your-webresource-name> folder and:
- Change the value of the title tag of the
./index.htmlpage to provide a meaningful title for your webresource. - If needed, in the same
./index.htmlpage change the relative url of./ClientGlobalContext.js.aspxpage. - Update
./src/App.tsxfile, the entry point of your custom webresource. - Calculate the path of the folder where you want to save the build outputs, relative to the one of the current package, search for all the occurrence of the
<output path>string and replace it with the calculated path (there should be just 1 occurrence, in thevite.config.tsfile). - Update the
nametoken in thepackage.jsonfile setting a meaningful name for your webresource