coffeescript
coffeescript copied to clipboard
CoffeeScript ESM loader
fix https://github.com/jashkenas/coffeescript/issues/5401

❯ 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)
Thanks, there’s also https://github.com/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.
谢谢,还有https://github.com/nodejs/loaders-test/tree/main/coffeescript-loader更多的参考实现(你的基础是这个,还是节点文档中的示例? )。
我需要弄清楚如何在项目中处理 ESM,然后才能实现它。可能会添加一个
"exports"
字段等。
this can use with CommonJS , but coffeescript-loader can't

i write a new version there https://github.com/iuser-dev/nodejs-loader/blob/main/src/index.coffee
this version can both use import './xx.coffee'
or import './xx'
@usrtax What is coffee_plus
?