Releases: swc-project/swc-node
Releases · swc-project/swc-node
@swc-node/[email protected]
Experimental esm
support
node --loader=@swc-node/register/esm ./src/index.ts
in this project
src/index.ts
import assert from 'node:assert'
import test from 'node:test'
import { supportedExtensions } from 'file-type' // pure esm project
await test('file-type should work', () => {
assert.ok(supportedExtensions.has('jpg'))
})
tsconfig.json
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
}
}
package.json
{
"type": "module"
}
output
> node --loader=@swc-node/register/esm ./src/index.ts
(node:77682) 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)
(node:77682) ExperimentalWarning: The test runner is an experimental feature. This feature could change at any time
TAP version 13
# Subtest: file-type should work
ok 1 - file-type should work
---
duration_ms: 0.642416
...
1..1
# tests 1
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 5.702292
What's Changed
- Experimental esm loader by @Brooooooklyn in #643
Full Changelog: https://github.com/swc-project/swc-node/compare/@swc-node/[email protected]...@swc-node/[email protected]
@swc-node/[email protected]
@swc-node/[email protected]
1.2.8 (2023-02-10)
Note: Version bump only for package @swc-node/loader
@swc-node/[email protected]
1.5.9 (2023-02-10)
Note: Version bump only for package @swc-node/jest
@swc-node/[email protected]
0.2.4 (2023-02-07)
Note: Version bump only for package @swc-node/sourcemap-support
@swc-node/[email protected]
@swc-node/[email protected]
@swc-node/[email protected]
1.2.7 (2023-02-07)
Note: Version bump only for package @swc-node/loader
@swc-node/[email protected]
1.2.6 (2023-02-07)
Note: Version bump only for package @swc-node/loader
@swc-node/[email protected]
1.5.8 (2023-02-07)
Note: Version bump only for package @swc-node/jest