-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Execute complied code #2145
Comments
Do you mean like these?
I'm not affiliated with these projects and have not tried them, but I believe they do what you're asking for. |
Writing to disk isn't that harmful. But if you want to execute code written in ESM, there is a way -- via import(dataurl). |
This exactly! Would be great if the API allowed for this directly. At the very least it might be worth documenting. Thanks! Should I leave this open as a feature request? |
That's true. So I still recommend you to really write it to disk, in which case you can use sourcemaps to point back to the real file. |
There is a request to allow passing in a virtual (in-memory) file-system here: #690 It looks like the use-cases described there are similar to this. |
I have a react component that I use as a template to generate a
index.html
file. This component takes the name of outputs (e.g.app-NU43JK4C.js
) and inserts it as a script tag. The issue is that being in jsx, I need to compile this script before it can be executed. Ideally, I'd prefer not writing it to disk at all.I'm aware of transpile, but that wont import all the dependencies.
Is there some way to compile and run code in a single go?
Here is a simplified version of the component:
The text was updated successfully, but these errors were encountered: