Skip to content

Conversation

@sebranchett
Copy link

This is related to issue #36.

The problem it solves is:
Jupyter Notebook widget needs images to be in lined (no references).
esbuild does this if you use the syntax:
import myimg from './assets/myimg.png';
mocha testing however will not accept this syntax .

This is a very hacky fix, that replaces GetImage.js with the
URL(imagePath, import.meta.url).href;
syntax before testing and restoring the ‘import’ syntax after testing.

Works for:

  1. widget
  2. stand-alone
  3. testing

The Copilot generated solution to issue #36 is more elegant, very complicated and I’m not convinced it will solve the problem addressed here.

I suggest we go with this hacky solution until we can come up with a better idea, that works for all 3 cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant