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

feat: added TypeScript + ts-node/esm and tsx/esm examples #76

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,570 changes: 7,570 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

1,007 changes: 1,007 additions & 0 deletions packages/hello-world/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions packages/typescript-ts-node-esm-loader/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
lib
4 changes: 4 additions & 0 deletions packages/typescript-ts-node-esm-loader/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extension": ["ts"],
"spec": "src/**/*.spec.ts"
}
16 changes: 16 additions & 0 deletions packages/typescript-ts-node-esm-loader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# TypeScript with `ts-node/esm` Loader

A standalone project showing TypeScript source files transpiled on-the-fly with [`ts-node/esm`](ts-node/register`](https://typestrong.org/ts-node/docs/usage/#node-flags-and-other-tools) as a Node ECMAScript Modules loader.

```shell
npm i
npm run test
```

Note that the `tsconfig.json` file has `compilerOptions`:

- `"noEmit": true`: as there's no need to transpile `.ts` files on disk to `.js` files on disk before running these tests
- `"module": "ESNext`: indicating code should be transpiled in-memory as ESM

Additionally, `package.json` has `"type": "module"`.
If it didn't, TypeScript source files would need the `.mts` extension.
Loading
Loading