-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Support to load ES module plugin #5525
Comments
We may need to wait for nodejs/node#37648 |
Hexo was born before I don't know if dynamic import will work in the |
IMO, we should not always be trapped by history.
Available with |
But we should avoid breaking change that results in a migration that would take more than more than 10 minutes. The
And I notice that Node.js doesn't recommend that option in production for now. So we ran out of the option. |
I do not mean to replace
Yes, that's a problem. How about introducing new plugin APIs that do not rely on the top-level For example, we can require all ESM plugins to expose a function that receives the context and initializes the plugin. export default async function (hexo_instance_as_arg0) {
hexo_instance_as_arg0.do_something();
} Then they can be loaded simply by dynamic import, eliminating the need for the
|
I think it's worth considering trying other loaders (similar to jiti, ts-node) that can achieve the same functionality as currently, and allow plugins to choose which module to use. The I believe using |
Check List
Feature Request
Support to load ES module plugin
Others
No response
The text was updated successfully, but these errors were encountered: