What is "index.runtime.*.js"? #9490
Replies: 4 comments 1 reply
-
Poking around the source map and Parcel source code, I think this is the "prelude", but I'm not yet sure what it's for and whether or not it's ok that my release doesn't contain it (other than logging an error, of course). Edit: also confirmed that this was not being included before. |
Beta Was this translation helpful? Give feedback.
-
Related question: is there a way to avoid/disable whatever generates this file? |
Beta Was this translation helpful? Give feedback.
-
I think I found the relevant code: https://github.com/parcel-bundler/parcel/blob/874dddf3eeeb1a57cb53f19bfdc171401f53f579/packages/core/core/src/applyRuntimes.js#L43C1-L61C2 I suspect it is for "runtime" plugins, but it looks like runtime plugins are in the default configuration, so I'm not sure I can avoid having this file generated. Tangentially related to my question: the reason I was trying to find information about this file is that it wasn't having its name adjusted by a namer plugin I'm using, and I think this comment indicates this is known behavior: // We don't run custom namers on runtime bundles as the runtime assumes that they are
// located at the same nesting level as their owning bundle. Custom naming could
// be added in future as long as the custom name is validated. Edit: this comment has some information as well: #9309 (comment) |
Beta Was this translation helpful? Give feedback.
-
I too would love to know how to prevent this as it is preventing me from upgrading Parcel beyond version 2.8.3. Parcel kindly generates a dynamic blob when it needs to import a worker script from another origin, which worked great in version 2.8.3, but now it doesn't work because it doesn't know handle this intermediate runtime script its generated during the build. |
Beta Was this translation helpful? Give feedback.
-
I have a trivial HTML file which only includes a single script (although that script transitively includes quite a bit!), and I don't think I used to see this, but it's now generating two scripts: "index.*.js" (expected) and "index.runtime.*.js" (which I'm curious about).
My trivial HTML:
I searched the web, issues, and discussions and couldn't find an explanation. I'm probably wrong, but I don't think I used to see this file.
For what it's worth, I wasn't including the file in my Electron app (because I didn't know about it) and nothing obvious was breaking. It's a pretty short file, but it's minified so not obvious what it's doing. The script is included in my HTML
<head>
:Beta Was this translation helpful? Give feedback.
All reactions