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
body {
background-image: url("../images/image.png");
}
image.png is arbitrary and index.js is empty.
Running parcel build src/css/example.scss src/js/index.js from the top-level project/ directory results in a dist/ directory with the following contents:
That's fine, but dist/css/example.cssshould contain a valid url(...) reference:
body{background-image:url(../image.72099d14.png)}
😯 Current Behavior
Unfortunately, dist/css/example.css contains an invalid url(...) reference:
body{background-image:url(image.72099d14.png)}
Note the lack of ../ -- a bug.
Alternatively, I suppose we could argue that the bug is actually the fact that example.css is placed in the dist/css/ subdirectory, rather than directly in the dist/ directory. If we placed example.css and index.js in the top-level dist/ instead, then we'd have something equivalent to running parcel build twice, once for each entry.
By the way, this isn't a requirement, but my expectation (as a first time parcel user) was that dist/ would actually contain an images/ subdirectory in this case, and the actual link in dist/css/example.css would be:
If someone could comment which direction the bug actually is (either the URL is wrong, or the placement of files in dist/ is wrong), I might be interested in looking under Parcel's hood to see what fixing this would take. Thanks!
🐛 bug report
When using
parcel build
with multiple entries, URL rewriting can fail.🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
Given the following directory structure:
Full content of
example.scss
:image.png
is arbitrary andindex.js
is empty.Running
parcel build src/css/example.scss src/js/index.js
from the top-levelproject/
directory results in adist/
directory with the following contents:That's fine, but
dist/css/example.css
should contain a validurl(...)
reference:😯 Current Behavior
Unfortunately,
dist/css/example.css
contains an invalidurl(...)
reference:Note the lack of
../
-- a bug.Alternatively, I suppose we could argue that the bug is actually the fact that
example.css
is placed in thedist/css/
subdirectory, rather than directly in thedist/
directory. If we placedexample.css
andindex.js
in the top-leveldist/
instead, then we'd have something equivalent to runningparcel build
twice, once for each entry.By the way, this isn't a requirement, but my expectation (as a first time parcel user) was that
dist/
would actually contain animages/
subdirectory in this case, and the actual link indist/css/example.css
would be:💁 Possible Solution
🔦 Context
💻 Code Sample
See attachment for example project directory.
project.zip
🌍 Your Environment
parcel
version1.10.3
The text was updated successfully, but these errors were encountered: