dprint / dprint-plugin-typescript

TypeScript and JavaScript code formatting plugin for dprint.
https://dprint.dev/plugins/typescript
MIT License
248 stars 50 forks source link

Q: Plugin Location #603

Open hinogi opened 5 months ago

hinogi commented 5 months ago

I see that the plugin string for tsconfig is an url. Does that mean you can only use the plugin if you also have access to the internet? or is there a npm package where to use it from?

dsherret commented 5 months ago

You need access to the internet to download the wasm file (similar to how initially downloading an npm package needs the internet) and then it's cached after that. One possibility is to to download the wasm files, include them in the repo, then reference it via a relative path. Alternatively, you can include the @dprint/typescript npm dependency then reference the plugin.wasm file as a relative path found in the package: https://www.npmjs.com/package/@dprint/typescript?activeTab=code (ex. ./node_modules/@dprint/typescript/plugin.wasm)

Note that because the plugins are .wasm files they run sandboxed in a Wasm runtime with no access to outside resources.

hinogi commented 5 months ago

ok so I can just adjust the path to the node_modules path.