Closed mkampmey closed 3 years ago
It is expected, you need to inject window.modifyPublicPath
function before webpack code, without reproducible test repo or example I can't help, sorry, feel free to feedback
Apparently I just had to stringify my postTransformPublicPath
function to: return "modifyPublicPath(" + p + ")"
Expected Behavior
I read the docs of the file loader and noticed that you can use the property
postTransformPublicPath
to modify your public path based on variables that are only available during runtime. If it works with variables it should also work with methods I guess. So my expectation is that I can use a method for examplewindow.modifyPublicPath()
which only exists during runtime but not during build process.Actual Behavior
If I use
window.modifyPublicPath()
or justmodifyPublicPath()
I get a ReferenceError saying thatwindow
ormodifyPublicPath
is not defined. So how should I use variables/methods that are only available during runtime if the build process already has to know them?Code