MK (fengmk2)
MK (fengmk2)
```bash Exception during run: ReferenceError: __dirname is not defined in ES module scope ``` 解决办法 ```ts import path from 'node:path'; import { fileURLToPath } from 'node:url'; const __filename = fileURLToPath(import.meta.url);...
https://johnnyreilly.com/dual-publishing-esm-cjs-modules-with-tsup-and-are-the-types-wrong 通过 @arethetypeswrong/cli 来检查配置是否正确
通过字符串替换解决 `import.meta` 在 commonjs 中的语法错误问题。 https://github.com/node-modules/tshy-after/pull/1
支持自动复制 web 相关文件 https://github.com/node-modules/tshy-after/pull/2
> 大佬,目前egg.js有什么办法可以在让应用不使用ts的情况下支持esm吗 目前 egg 发布的 npm 包只支持 cjs 产物。需要等 egg v4 发布之后才会同时支持 cjs 和 esm 构建产物。
@shizhx 非常好的特性,来个 pr 贡献实现一下?
https://github.com/bytedance/node-unix-socket
https://www.eggjs.org/zh-CN/basics/controller#%E8%8E%B7%E5%8F%96%E4%B8%8A%E4%BC%A0%E7%9A%84%E6%96%87%E4%BB%B6 建议你改成 File 模式,Stream 模式需要做很多处理才能做好这件事情。 你上面贴的代码明显就是没有处理好各种异常边界条件,导致临时文件没有处理。
可以贴一下示例代码。
真 Symbol 没法被 copy 的,除非你拿到了 Symbol 的引用才能获取属性值。