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
I currently have a package on npm which dual publishes for both ESM and CJS, however have noted that import-cost doesn't seem to be able to produce a size metric when importing the package. The specific package can be located at the following npm link.
This package is configured somewhat differently in the respect it makes use of a technique referred to as package-json-redirect. This technique helps to ensure correct module resolution for node10 and pre and post node16 module resolution (with and without ESM), as well as helping TypeScript correctly resolve types for the configured moduleResolution target. Information on the technique can be found at the following URL.
It would be great if import-cost could produce a size metric for this library as quite a lot of work has been carried out recently to reduce ESM bundled output, this specifically to get utilization from the import-cost tool. If there's anything that can be done library side to provide configurations to import-cost to help it produce a metric, id be happy to explore that.
Thanks for this amazing tool.
The text was updated successfully, but these errors were encountered:
Going to close this one off as the issue appears to be TypeBox package.json configuration related, where WebPack silently fails when the default import target are not specified last.
I currently have a package on npm which dual publishes for both ESM and CJS, however have noted that import-cost doesn't seem to be able to produce a size metric when importing the package. The specific package can be located at the following npm link.
https://www.npmjs.com/package/@sinclair/typebox/v/0.32.0-dev-28
and installed with
This package is configured somewhat differently in the respect it makes use of a technique referred to as
package-json-redirect
. This technique helps to ensure correct module resolution for node10 and pre and post node16 module resolution (with and without ESM), as well as helping TypeScript correctly resolve types for the configuredmoduleResolution
target. Information on the technique can be found at the following URL.https://github.com/andrewbranch/example-subpath-exports-ts-compat/tree/main/examples/node_modules/package-json-redirects
And do note that bundlephobia is able to make sense of these redirects.
https://bundlephobia.com/package/@sinclair/typebox@0.32.0-dev-28
It would be great if import-cost could produce a size metric for this library as quite a lot of work has been carried out recently to reduce ESM bundled output, this specifically to get utilization from the import-cost tool. If there's anything that can be done library side to provide configurations to import-cost to help it produce a metric, id be happy to explore that.
Thanks for this amazing tool.
The text was updated successfully, but these errors were encountered: