dop251 / goja_nodejs

Nodejs compatibility library for Goja
MIT License
329 stars 78 forks source link

Prioritise native modules #42

Closed mariotoffia closed 1 year ago

mariotoffia commented 1 year ago

Hi and thanks for this wonderful project!! :)

I've been using it in our framework for a while and I saw that you downprioritized the resolving of native modules. Is it possible to do this configurable?

I've done a ugly hack to achieve this.

Cheers, Mario :)

image

dop251 commented 1 year ago

Hi. I don't believe this is necessary, if you don't want a module override a native one, you could provide your own SourceLoader in which you would ignore a module if its name matches a native. It even gives you more flexibility because you can choose which ones you want overwritten and which ones you don't.

mariotoffia commented 1 year ago

Many thanks!! :)