How do you do this?
I have a statement that looks like this:
import data from '/../server/data.json';
I want to see the full path of the resolved file.
I know that there's resolve()
for node but thats backend I want to do it on front end
How to get full path from relative path
The problem with this answer is it's jquery - can you do it without?
Converting Relative Paths to Absolute Paths
Not JS but java
Javascript paths relative to file
This is the closest, so I tried
import data from '/../server/data.json';
console.log(data.href)
This obviously doesn't work because it's not a valid attr.
My biggest issue here is trying to do this with an import
statement. none of the attached answers discuss this.
Is this possible? Or am I in a black hole?