Skip to content
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

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants