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

CoffeeScript ESM loader #5423

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

CoffeeScript ESM loader #5423

wants to merge 1 commit into from

Conversation

usrtax
Copy link

@usrtax usrtax commented Aug 1, 2022

fix #5401

image


❯ cat test.coffee
#!/usr/bin/env coffee

console.log 1
❯ cat package.json
{
  "type": "module"
}
❯ node -v
v18.7.0
❯ node --loader "../loader.mjs" test.coffee
(node:28894) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

@GeoffreyBooth GeoffreyBooth self-assigned this Aug 1, 2022
@GeoffreyBooth
Copy link
Collaborator

Thanks, there’s also https:/nodejs/loaders-test/tree/main/coffeescript-loader which is more of the reference implementation (did you base yours off of this, or of the example in the Node docs?).

I need to work out how to handle ESM in general in the project before we can land this. Probably add an "exports" field, etc.

@usrtax
Copy link
Author

usrtax commented Aug 2, 2022

谢谢,还有https:/nodejs/loaders-test/tree/main/coffeescript-loader更多的参考实现(你的基础是这个,还是节点文档中的示例? )。

我需要弄清楚如何在项目中处理 ESM,然后才能实现它。可能会添加一个"exports"字段等。

this can use with CommonJS , but coffeescript-loader can't

image

i write this base on nodejs documents , but there is error to use code in nodejs documents when use nodejs 18.7.0

@usrtax
Copy link
Author

usrtax commented Aug 5, 2022

i write a new version there
https:/iuser-dev/nodejs-loader/blob/main/src/index.coffee

this version can both use import './xx.coffee' or import './xx'

@STRd6
Copy link
Contributor

STRd6 commented Oct 15, 2022

@usrtax What is coffee_plus?

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

Successfully merging this pull request may close these issues.

feat: CoffeeScript ESM loader
3 participants