Hi everyone,

I am currently trying to set up Transformers.js in a plugin too. However, I've encountered several problems such as:

  • I have same problem with node-loader not working and seeing .node files are in dist folder.
  • Using resolve.alias and externals solve the loader issue but the problem now seems to be that onnxruntime-web is not part of the build since it's unable to find the InferenceSession object to call create.

Does anyone have ideas how to tackled this issue?

I am currently reading about webpack since I have only basic knowledge about that so I might be missing something. I also saw that you can import the library via CDN:

<script type="module">
    import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.17.1';
</script>

Would we be able to import modules from CDNs into a plugin if we could not make Transformers.js work? I think it still keeps privacy for users but unfortunately they have to be connected to the internet.