dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

Q: Plugin Location

Open hinogi opened this issue 1 year ago • 2 comments

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?

hinogi avatar Jan 16 '24 16:01 hinogi

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.

dsherret avatar Jan 16 '24 16:01 dsherret

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

hinogi avatar Jan 16 '24 21:01 hinogi