I am using django as a backend with a few js packages installed with npm. I am currently accessing the packages by allowing django to serve /node_modules by adding it to the STATICFILES_DIRS. This has been working, but I have to go in the pacakge and find the js file I want to point to and then load it using a <script src="{% static ....
This is a bit tedious and seems a bit "hacky." I also cannot figure out how to use imports/requires inside my js files. Is there a way to use imports or am I stuck loading everyting via script tags? I assume this is because django doesn't know how to server the npm packages appropriately? I've read a bit into webpack and I'm still unsure if webpack is a solution to my problem. Any advice?