| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 53afb0e commit 3beaf9c
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,11 +41,31 @@ node --import="amaro/strip" file.ts | |||
| 41 | 41 | Enabling TypeScript feature transformation: | |
| 42 | 42 | ||
| 43 | 43 | ```bash | |
| 44 | - node --experimental-transform-types --import="amaro/transform" file.ts | ||
| 44 | + node --enable-source-maps --import="amaro/transform" file.ts | ||
| 45 | 45 | ``` | |
| 46 | 46 | ||
| 47 | - > Note that the "amaro/transform" loader should be used with `--experimental-transform-types` flag, or | ||
| 48 | - > at least with `--enable-source-maps` flag, to preserve the original source maps. | ||
| 47 | + > Note that the `amaro/transform` loader should be used with `--enable-source-maps` | ||
| 48 | + > to preserve accurate source-mapped stack traces. | ||
| 49 | + | ||
| 50 | + #### Programmatic registration with `module.register()` | ||
| 51 | + | ||
| 52 | + If you want TypeScript to "just work" in an existing codebase without passing `--import` every time, create a small bootstrap file and register Amaro once before loading your TS entrypoint. | ||
| 53 | + | ||
| 54 | + ```mjs | ||
| 55 | + // bootstrap.mjs | ||
| 56 | + import { register } from "node:module"; | ||
| 57 | + | ||
| 58 | + register("amaro/strip", import.meta.url); | ||
| 59 | + await import("./src/index.ts"); | ||
| 60 | + ``` | ||
| 61 | + | ||
| 62 | + Then start your app through the bootstrap file: | ||
| 63 | + | ||
| 64 | + ```bash | ||
| 65 | + node --watch ./bootstrap.mjs | ||
| 66 | + ``` | ||
| 67 | + | ||
| 68 | + For transform mode, swap `amaro/strip` with `amaro/transform` and run Node with `--enable-source-maps`. | ||
| 49 | 69 | ||
| 50 | 70 | #### Type stripping in dependencies | |
| 51 | 71 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | "강동윤 <kdy1997.dev@gmail.com>" | |
| 5 | 5 | ], | |
| 6 | 6 | "description": "wasm module for swc", | |
| 7 | - "version": "1.15.11", | ||
| 7 | + "version": "1.15.18", | ||
| 8 | 8 | "license": "Apache-2.0", | |
| 9 | 9 | "repository": { | |
| 10 | 10 | "type": "git", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "name": "amaro", | |
| 3 | - "version": "1.1.7", | ||
| 3 | + "version": "1.1.8", | ||
| 4 | 4 | "description": "Node.js TypeScript wrapper", | |
| 5 | 5 | "license": "MIT", | |
| 6 | 6 | "type": "commonjs", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,5 +2,5 @@ | |||
| 2 | 2 | // Refer to tools/dep_updaters/update-amaro.sh | |
| 3 | 3 | #ifndef SRC_AMARO_VERSION_H_ | |
| 4 | 4 | #define SRC_AMARO_VERSION_H_ | |
| 5 | - #define AMARO_VERSION "1.1.7" | ||
| 5 | + #define AMARO_VERSION "1.1.8" | ||
| 6 | 6 | #endif // SRC_AMARO_VERSION_H_ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments