I have two files:
In target.js:
The trick is to give webpack a config-hint on what to base its paths on:
Use:
"output": { "publicPath": "/" }
To tell webpack not to be relative.