Replies: 1 comment 1 reply
-
hey @lancety . How did you convert geckos to cjs? I also use pkg to deploy server-code, where dynamic imports of ES modules is not supported. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The readme mentioned now we are using es module and configed everything es module because many mdoules using es module.
The issue is - there are many cases and popular modules still doing things the commonjs way. For making things easier, in lots of cases, developers dont need to bundle node_modules in the final output package, when the package working under commonjs mode, it uses node_modules, and the npm installed geckos package has 'type': 'module', so developers have to make their way to convert, and because this module used binary '.node' files, it made the process little more complex as well.
For example: I have a server app built by using vercel/pkg module, this module does not support packing es module, so I compiled my server code to commonjs module, but then I have to convert geckos.io common and server to commonjs module. The issue is - for sharing code of client side and code of git submodules, the 'common' and 'client' geckos module need to be es module, so things become complex.
So what I think we can do is - client side is normally es module , which is ok. Server side might be es module, or have to be commonjs module, how about when publish to npm we have commonjs support for server side code, or both es module and commonjs module version?
Or maybe there are easy way for this use case I dont know.
:D
Beta Was this translation helpful? Give feedback.
All reactions