I'm trying to change the backend of my React app to be only Flask based, instead of having two different servers ('npm' and 'flask').
The app was created with 'create-react-app' and the current folder structure is:
- myapp
- node_modules
- src
- App.js
- index.js
- index.css
- App.css
- templates
- index.html
app.py
package.json
The app.py file consists of this code:
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
if __name__ == '__main__':
app.run(debug=True)
The thing is, until now on every save, the npm automatically bundled and reloaded all of my changes in the browser. Now, if I make a change, for example, in the 'index.html', the change is visible in the browser. However, if I try to edit my 'App.js', the change isn't visible at all.
From now on, do I need to rebundle the 'App.js' and components by myself everytime I save them?
I'm a bit confused about this one, so any help or advice would be highly appreciated.