New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect asset path when namer puts file in subdirectory. #4172
Comments
Your setup in the zip: <script type="module">
import "./index.js";
</script> // index.js
import("./lib.js")
// lib.js
export default "foo"; The HTML asset is transformed and a child asset is generated for the inline JS asset (which gets a path like I think inline assets shouldn't get named by a |
That makes sense. There is no point in namers naming bundles that are never written somewhere. If they need to have a temporary name for processing then you proposal of some function of the name of the parent asset seems good. |
I think it doesn't have to be a real hash. |
Just confirming that bug is still present on 2.8.3. |
🐛 bug report
When a namer puts different files in different directories import paths between the files are incorrect.
🎛 Configuration (.babelrc, package.json, cli command)
See the attached setup with a trivial namer and some basic files.
parcel-namer-bug.zip
🤔 Expected Behavior
The import statement should reference a file that exists. (
./a/4e3b3082.js
)😯 Current Behavior
The import statement references a file that doesn't exist.
🔦 Context
It is unclear where this reference is being generated relative to. Because if you change the namer to put entires into a subdirectory and other files in the root it generates the exact same path for the import. (the proper path would be
../{hash}.js
)💻 Code Sample
Namer code (also in zip):
🌍 Your Environment
The text was updated successfully, but these errors were encountered: