-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Cannot be used as dynamic import #11
Comments
JonathanCabezas
changed the title
Use as dynamic import
Cannot be used as dynamic import
Aug 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I did a custom script that you can use as npm pre-start hook that will run
expose-wsl
every time Windows has been rebooted:It works great but I'd prefer to first import
expose-wsl
and then write thebootTimeFile
, but I can't sinceexpose-wsl
ends withprocess.exit
.If you want to use your package both as an entrypoint and as a module, you should encapsulate all your processing logic into a function which throws error (success true by default instead of success false by default as you do).
Then if you are in main (you can use the package es-main to check this), you can catch any error and do
process.exit(1)
:The text was updated successfully, but these errors were encountered: