Closed elijaholmos closed 2 years ago
@elijaholmos Released in v1.5.0, should work now:
thanks for the quick response, @ambar! the extension works much better:
only problem I see now is in the above screenshot with firebase-admin/database
. here's the extension output for my file:
not sure if this is a problem with my machine, the firebase-admin
package, or something else π
I don't mind one package not working, though- everything else has worked greatly!
@elijaholmos Thanks for the feedback, I'll look at that question when I have time.
@ambar No rush. enjoy the rest of your day
It seems firebase-admin
is a package that only supports node, not browser (which is the default of the Bundle Size plugin), at least in current version of esbuild (maybe a compatibility issue of exports
field).
# ok
echo "import { getDatabase } from 'firebase-admin/database'" | yarn esbuild --bundle --platform=node --minify > bundle.js
# fail
echo "import { getDatabase } from 'firebase-admin/database'" | yarn esbuild --bundle --platform=browser --minify > bundle.js
β [ERROR] Could not resolve "@firebase/database-compat/standalone"
node_modules/firebase-admin/lib/database/index.js:20:29:
20 β const standalone_1 = require("@firebase/database-compat/standalone");
β΅ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The path "./standalone" is not currently exported by package "@firebase/database-compat":
node_modules/@firebase/database-compat/package.json:16:13:
16 β "exports": {
β΅ ^
None of the conditions provided ("types", "node") match any of the currently active conditions
("browser", "default", "require"):
node_modules/@firebase/database-compat/package.json:27:20:
27 β "./standalone": {
I see, so it looks like it's an issue on the package level. thank you for looking into it!
many nodejs projects leverage Bare Module Specifier (https://github.com/jkrems/proposal-pkg-exports) to specify custom package imports/exports in the
package.json
. for example, seefirebase-admin
sdk or even a smaller package likeset-interval-async
.the
package.json
for these modules will typically be structured like so:notice how
./package.json
is not included.currently, the extension errors when attempting to resolve the bundle size of these modules, with an error like so:
My feature request is to support the bare module specifier syntax as described above.