React JS project is not bootstraped with CRA(create react app).
Webpack is configured in a way it injects scripts and styles inside _Layout.cshtml based on a template file _Template.cshtml.
Webpack splits the output bundle as well as hashed name is used to force the browser to reload if any changes has been made.
- Install all Nuget packages by right-clicking the Solution (on Visual Studio) and selecting Restore Nuget Packages.
- React dependencies:
- Go to the root folder, which is wwwroot on the command prompt or can also be done using Visual Studio Code. Right-click the folder wwwroot and
select Open With Code. Use Visual Studio Code to run
npm install
- Alternatively, open wwwroot on command prompt and type 'npm install'
- Go to the root folder, which is wwwroot on the command prompt or can also be done using Visual Studio Code. Right-click the folder wwwroot and
select Open With Code. Use Visual Studio Code to run
- On Visual Studio Code terminal or command prompt, type
npm run start
for development ornpm run build
for production. - Hit F5 on Visual Studio to run IIS Express.
- Application will be loaded in the choosen browser (in Visual Studio).
Remember, I have used two names above Visual Studio and Visual Studio Code!
- No hot-reloading feature as scripts are injected in _layout.cshtml and uses IIS express as web server rather than webpack dev server.