You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then this path is tranformed into the output file as-is
import foo from '/some/absolute/path.hashcode123.min.js'
Actual Behavior / Situation
this path is mangled in the output file into something like
import foo from '../../../../some/absolute/path.hashcode123.min.js'
which works in my case now only by accident (there are enough ../ to get to the root path in the browser)
Modification Proposal
do not path.relative() the id returned from resolveId when the id is marked as external.
using output.paths is not an option for me - I don't know the paths up front and I need to do some tricky resolutions
The text was updated successfully, but these errors were encountered:
fanick1
changed the title
resolvedId() - absolute paths of external modules are not to be converted to relative paths
resolveId() - absolute paths of external modules are not to be converted to relative paths
Jan 28, 2021
I was lucky enough to run into a case where the rollup does not put enough '../' into the path and now the module (let's say the module in the example path.hashocde123.min.js) cannot be found because I am serving one module too deep in the URL structure.
A quick workaround I had to do is to prepend the module id returned from the resolveId() with few '../' :
Expected Behavior / Situation
for some arbitrary module id a plugin with the
resolveId()
hook resolves this id to:then this path is tranformed into the output file as-is
import foo from '/some/absolute/path.hashcode123.min.js'
Actual Behavior / Situation
this path is mangled in the output file into something like
import foo from '../../../../some/absolute/path.hashcode123.min.js'
which works in my case now only by accident (there are enough ../ to get to the root path in the browser)
Modification Proposal
do not
path.relative()
the id returned fromresolveId
when the id is marked as external.using
output.paths
is not an option for me - I don't know the paths up front and I need to do some tricky resolutionsThe text was updated successfully, but these errors were encountered: