I have a React application created using create-react-app
. I also have an external application that is using this application by including the bundled JS
and CSS
files (the ones create using the build
script).
Right now, I'm using the React template created by the dotnet new
command, and I have configured the server to serve static files located in the build
folder.
For this reason, I have created a couple of additional NPM scripts that rename the bundle files (remove the hash from the name), so that I don't need to update my external application's links with every build.
Right now, whenever I change something in the code, the whole build process has to be processed to create the two files.
I have created a "watch" task to run my build scripts whenever I have a change, but I was wondering if there is a way to speed up the process and somehow configure the React application to be served from memory or something just like when we "normally" run the application.
So, maybe a couple of questions:
- How to achieve this in a "normal" React app created by
create-react-app
? - how to achieve this in the context of the
dotnet
template?