Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Use external modules without filesystem access #529

Open
code4break opened this issue May 23, 2023 · 1 comment
Open

Use external modules without filesystem access #529

code4break opened this issue May 23, 2023 · 1 comment

Comments

@code4break
Copy link

Hello,

I use vm2 with externals modules. This works fine on my developer machine within VS Code.

For production I use pm2 on Windows machine, which has no file access at runtime.

Is it possible to include the files from node_modules to vm2 before runtime?

Thanks

@CheerlessCloud
Copy link

If I understood your question correctly, you want to put all the code together with dependencies into one file which you can then read and run on vm2 without the need to pass require/dependencies into context manually. I think @vercel/ncc might work for you. Under the hood is a webpack with additional plugins that help you to properly build a script for nodejs into single file bundle with all the dependencies.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants