I have a project made with Django (only DRF API) and Vue js. I have this project structure:
root_directory/
├── project_name/
│ ├── settings.py
│ ├── ...
├── front_end/
│ ├── ... vue files generated with CLI 3 ...
└── api/
└── ... api app files ...
I want to deploy this project using heroku and my biggest problem is: I don't know how to serve static files (vue app files).
In heroku docs is specified that I should use django staticfiles serving with whitenoise package (apart from hosting them in S3).
But here comes another problem: vue-cli provided me a index.html file where everything gets injected when I run npm run build, so I can't access {% static 'example.js' %} in index.html directly, cause it is not the index.html that I should use, it is the one in dist/ folder, of course. But there everything gets minified and too complicated for me to handle. I think npm run build would throw an error if it sees something like {% %} in public/index.html.
I can't figure out how can I manage to deploy this project with heroku. What would be the best practice to deploy it in this situation?
Thanks in advance.
server.jsfile for example. There a lot of tutorials on how to "Deploy Django app to Heroku" and "Deploy Vue app to Heroku".