Open fregante opened 9 months ago
I also tried using the same exact path in both, to no avail:
import appUrl from 'url:./index.html';
"action": {
"default_icon": "logo.png",
"default_popup": "./index.html"
},
Does new URL("index.html", import.meta.url)
cause the same problem?
Yes. I also tried matching the exact string in both ways: index.html
, ./index.html
Still reproducible with today's canary. Sub-dependencies are also duplicated:
file.hash.html
imports:
file.hash.css
file.hash.js
file.anotherhash.html
imports:
file.anotherhash.css
file.anotherhash.js
contents are 100% match except these import paths.
I'm seeing the same issue with just manifest.json
in the latest canary after this was fixed:
The repro:
{
"background": {
"type": "module"
"service_worker": "background.js",
"scripts": [
"background.js"
]
},
}
The generated background.29017fde.js
and background.e1bfa0d5.js
are identical except the internal module IDs
🐛 bug report
In my extension, I mention the same file in the manifest and in a JS file. This causes Parcel to bundle the same file twice with two outputs. This in turn causes nearly every sub-import to also be duplicated. In this case the duplicate file was
source/index.html
(note that this screenshot was made aftertrash distribution && parcel build
)🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
The file should not be duplicated.
😯 Current Behavior
Two
html
files appear indist
💻 Code Sample
Full repro can be found in this PR (until commit
1009154
)Note that in my case, the manifest actually mentions
index.html?type=popup
, which is valid and could further cause issues, but the same bug appears even without the search parameter.🌍 Your Environment