Closed ilikerobots closed 3 years ago
Hi @ilikerobots, sorry for the delay in looking at this. This app was designed to assume all paths are Django staticfiles.
I could add a setting that would allow you to turn that off, and to just use the exact string that the manifest file is passing in. Would that solve your problem? You'd be able to use it something like this:
# settings.py
MANIFEST_LOADER = {
'map_to_staticfiles': not DEBUG
}
Where in this example if you were running in DEBUG mode it would just pass the exact string the manifest files is pointing to, and when you're not running in DEBUG mode it would work as normal. You could, of course, implement your own logic as to when to flip this setting to meet your own needs.
Alternatively, there could be a setting
# settings.py
MANIFEST_LOADER = {
'map_urls': False
}
This would inspect strings that are to be mapped to in order to see if they are a URL or not, and if they are it would skip the mapping.
Thoughts?
Sorry for the delay. I looked at the PR and I think you've picked the perfect way to handle it. The settings option above could be clunky because a difference in the rebuild of the JS project (e.g. vue serve vs vue build) would require also a change in the django settings.
Your implemented solution however solves the issue effectively and unambiguously I believe. Thanks.
I'm trying to run a Vue app in dev mode (i.e.
vue serve
from the CLI. My manifest correctly records URLs to the dev server, e.g.However, it seems that django-manifest-loader is presuming all resources in the manifest are paths to Django staticfiles. My template renders:
I'd like to be able to use django-manifest-loader to easily switch between dev mode and static build mode on my Vue app without altering any code. Is this possible?