Repository navigation
Also in 4.4.2 (11)
import url from 'pkg?url'now resolves a package that has anexportsmap, where it failed withPackage subpath './?url' is not defined.- An import of a file a package's
exportsfield hides now says what to do: the name the package exports that file under, query kept, or an alias written for the module type of yourextension.config.js. import(url)with a URL only known at run time stays a native import, in your code and inside packages such as@ffmpeg/ffmpeg, where it compiled into a call that always threw "Cannot find module".- A service worker that imports from a folder by name, as in
import(`./locales/${name}.js`), builds again with those files inside the worker. Since 4.2.0 it crashed the build. new Worker(new URL(url, import.meta.url))with a URL only known at run time builds that URL, in your code and inside packages, so@ffmpeg/ffmpeg'sload({classWorkerURL})starts its worker. It compiled into a call that always threw "Cannot find module".- A JavaScript module imported with
?urlships with the files it imports beside it, so@ffmpeg/ffmpeg/worker?urlworks asclassWorkerURL. It shipped alone and failed silently in the browser. When a file cannot be shipped, the build says which. - A warning about a file shipped under a content hash names the file as the output holds it.
- A worker your code starts with
new Worker(new URL('./file', import.meta.url))gets a file named after it in a production build, such assqlite-worker.da2b9732.js. Two worker files could swap their numbered names when the same project was built in another folder, so a rebuild did not match byte for byte. - A build stops when two modules shipped through
?urleach import a different file with the same name, since one would run the other's code. - The alias hint for a hidden package file fits the
extension.config.jsyou already have: only the lines to add, and every alias of one build in one block. - A package file imported with
?urlno longer draws a "file isn't in the output" warning for what it reads beside itself.
Fixes
- Stop the build when two ?url modules need different files of one name (#1491) (05c393899)
- Resolve a package root with a query, say how to reach a hidden file (#1484) (82599b8f6)
Other changes (8)
- Name the final file in a collision error, order alias errors by line (#1495) (48b4532ff)
- Name a project worker's file so a rebuild in another folder matches (#1494) (77e2ffafa)
- Read a lock refusal that outlasts the wait as held, not as a fault (#1492) (6b0b94d5c)
- Ship what a ?url module imports beside it, count static imports only (#1490) (568c5cf9d)
- Warn when a ?url module ships without its imports, name final files (#1489) (aeda1f0bf)
- Time a Windows quit from the Ctrl+C, not from the sender's compile (#1488) (b798b81d7)
- Build a run-time new URL as written, fit the alias hint to the config (#1486) (e5f8eb33a)
- Keep unplaceable imports native, fix the worker panic and alias hint (#1485) (93cd555fc)
Validated before publishing: extension@4.4.2-canary.493.48b4532, cut from the same commit, built every buildable sample of extension-js/corpus on Chrome, Firefox, Edge and Safari, and passed the extension-js/templates suite (run).