typescript compiler (38.24MB) included in bundle when importing google's npm:schema-dts

Not sure if this is a bug, but I couldn't see how the package imports the compiler. create a ts file with: import type { Accommodation } from "npm:schema-dts" deno info [file.ts] file.ts └─┬ npm:schema-dts@1.1.2 (857.9KB) └── npm:typescript@5.1.3 (38.24MB)
Doesn't seem like a bug to me since the NPM TypeScript package is separate
can you please explain a bit? importing a type should inflate the bundle so much?
schema-dts relied on the typescript NPM package, and that package is pretty large. I don't think there's a way to have an NPM package use Deno's TypeScript implementation
It's a dev dependenciy. also since I'm only importing a type, why does it bundle the runtime? https://github.com/google/schema-dts/blob/main/package.json
schema-dts/package.json at main · google/schema-dts
JSON-LD TypeScript types for Schema.org vocabulary - google/schema-dts
Because it cached the entire package and all its dependencies. If you only need the type and not the whole package, you can technically copy and paste the class into your project, or copy the entire type definition file and paste it into your project to use I don't know if Deno bundling is any good at tree shaking NPM packages

Looking for more? Join the community!

Recommended Posts
debug why a file is importedI get a compilation error from a ts file that shouldn't be imported. How can I debug the import chaiCan I rename my deno.land package?Is it possible? What should I do?Deno Compile in NixOS docker imageI'm trying to compile code to deploy to aws lambda functions. I can do it locally on my m1 mac just Discord User Authentication WebsiteCan anyone help me create a web server that allows users to login to their discord account and then Dynamic interfacesIs it possible to have like an interface that has a type entry and when it is a string for example tDisable / Replace Loading FaviconHaven't found anything regarding it and likely is not possible, however I thought I might as well sDeno test Leaking resourcesHi i currently try to get used to deno.test but Deno.readTextFile makes the test end in the followinDeno.Command arg with an asterisk?I am trying to execute a shell command from Deno, where one of the command args contains an asterisk`deno compile` in Nix results in `deno repl` starting instead of actual programI wrote following Nix impure derivation for my Deno app: ```nix packages.api = pkgs.stdenv.mkDerivat`@sentry/node` is throwing an export error on Deno DeployHello, this is my first time using Deno. I was trying to use the `@sentry/node` client on deploy, basync mapIs there anyway using the stdlib to map from one array to another array, with the work being done coHTTP 206 + HTML5 video streaming with Freshhow do I implement an endpoint to stream a video to a HTML video player using HTTP 206 in Fresh? Herrusty_v8 extracting stack trace when a promise rejectsHi, i am trying to get the stack trace and print it out when a promise rejects. ```rust if promise.sNode-API related segmentation faultAny idea what could be causing this crash? I'm using Node-API and the same module is working fine in