Django: How to import a javascript inside another javascript file
It's definitely not right to use Django template tags inside your JS files, since they will not be processed by Django's template loader. I'd suggest either:
(a) Use only relative path imports in your JS files.
or
(b) Set up your Django STATICFILE_DIRS
setting to include the node_modules directory and setting STATIC_ROOT
to something like '/static'. Then do your module imports as import { x } from '/static/path/to/module'
.
EDIT: Grammar