From 9c565838189a297bd2a8a0a7dd333af850d1587d Mon Sep 17 00:00:00 2001 From: Alice Pote Date: Wed, 10 Apr 2024 10:08:51 -0400 Subject: [PATCH] update CONTRIBUTING.md --- CONTRIBUTING.md | 11 +++++++++++ scripts/esbuild/util.ts | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2bd353eba14..b3c672939ad7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -131,6 +131,17 @@ stuck, your debugger may not have switched to a worker process that has halted o avoid this altogether by setting `--max-workers=1` when you launch Stencil (with the possibility of not being able to reproduce timing issues between workers as a side effect). +> [!NOTE] +> If you want to have access to sourcemaps when debugging the compiler locally +> you can run the `build` script in `package.json` with the `DEBUG` environment +> variable set to `true` like so: +> +> ```sh +> DEBUG=true npm run build +> ``` +> +> this will write a `.js.map` file to disk next to each JavaScript file. + #### Debugging the Compiler in VSCode Two launch configurations for debugging the compiler can be found in the `.vscode/launch.json` configuration found in diff --git a/scripts/esbuild/util.ts b/scripts/esbuild/util.ts index 0d2bb3d80c79..46b33fd57328 100644 --- a/scripts/esbuild/util.ts +++ b/scripts/esbuild/util.ts @@ -116,7 +116,7 @@ export function getBaseEsbuildOptions(): ESBuildOptions { target: getEsbuildTargets(), }; - // if the `build` subcomment is called with the `DEBUG` env var, like + // if the `build` sub-command is called with the `DEBUG` env var, like // // DEBUG=true npm run build //