-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for ESM Syntax #27
Comments
That's a great idea, it would be really handy to be able to use ESM. Regarding the first two, I'm not aware of any mechanism that would allow resolving those imports. However if we get the third one working, a bit of string replacement might work well enough... As far as standard ESM, Chrome doesn't let extensions directly execute "module" scripts, but I have an idea: Instead of using const s = document.createElement("script")
s.setAttribute("type", "module")
s.innerText = snippetContent
document.body.appendChild(s) After some quick testing, it seems to work! However there are a few limitations:
Feel free to take a stab at this if you're interested. Otherwise I'll try it when I get around to it. |
Yeah the first two were long shots for sure! My laptop is in the shop right now, but I'll take a crack at it once I get it back 😊 |
I haven't been able to get any actual coding started with this, work has been swamped, but I figured I'd share the resources I've found so far.
Maybe this will be useful to someone else who comes along and wants to give it a shot too. |
I don't know what the limitations are, but it would be nice to be able to use
import
andexport
syntax inside of the snippets. Getting to use SkyPack inside of a snippet or snippet imports, like this.The text was updated successfully, but these errors were encountered: