Lodestone-Team / lodestone_core

The backend for Lodestone, A free, open source server hosting tool for Minecraft and other multiplayers
https://www.lodestone.cc/
GNU Affero General Public License v3.0
59 stars 6 forks source link

Add npm package support #163

Open CheatCod opened 1 year ago

CheatCod commented 1 year ago

deno_runtime::WorkerOptions has a field: pub npm_resolver: Option<Arc<dyn deno_node::NpmResolver>>, which is default initialized to None.

If we provide it with an implementation of npm_resolver, we should be able to npm package support.

See more: https://github.com/denoland/deno/blob/main/cli/npm/resolvers/mod.rs.

Note this may be a deep rabbit hole, expect to spend hours on this

CheatCod commented 1 year ago

https://deno.land/x/deno@v1.35.2/cli/module_loader.rs prob need to change the module loader as well