You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 3, 2024. It is now read-only.
**Note:** The directory layout of the code that is being debugged does not have to exactly match the source code specified in the Debug UI. This is because the debug agent resolves a snapshot filename by searching for a file with the longest matching path suffix. If a unique match is found, that file will be used to set the snapshot.
142
+
143
+
An example will help illustrate this. That is, suppose that the code on the running instance is structured as follows:
144
+
```
145
+
/running/instance/package.json
146
+
/running/instance/main.js
147
+
/running/instance/a/index.js
148
+
/running/instance/b/a/index.js
149
+
```
150
+
Further, suppose the source code repository or local directory you have provided to the Debug UI is structured as follows.
151
+
```
152
+
package.json
153
+
main.js
154
+
a/index.js
155
+
b/a/index.js
156
+
```
157
+
158
+
In this case, if you specify a snapshot in file `b/a/index.js` in the Debug UI, the debugger will identify that that file corresponds to the file `/running/instance/b/a/index.js` of the code on the running instance, and the breakpoint will hit when the specified line of `/running/instance/b/a/index.js` is reached.
159
+
160
+
Note, however, if a snapshot is specified for the file `a/index.js` in the Debug UI, then the debugger would not know whether this file corresponds to the file `/running/instance/a/index.js` or `/running/instance/b/a/index.js`. If such an ambiguity occurs, the snapshot cannot be set and a message will be displayed in the Debug UI with additional information.
161
+
162
+
## Support for Transpiled Code
163
+
164
+
The debugger supports the use of transpiled code, whether it be Javascript to Javascript transpilation or transpilation from another language (such as Typescript) to Javascript. In order to use transpiled code with the debugger, sourcemaps need to be generated with the transpiled code. The sourcemaps need to be provided in `.js.map` files.
165
+
166
+
Further, you do not need to deploy the original source files to the deployment environment as long as the sourcemap files are available at runtime.
167
+
168
+
In the Debug UI, you only need to provide the original source code -- you don't need the transpiled output files or the sourcemaps. When you set a snapshot in an original source file in the Debug UI, the corresponding file and line in the transpiled code is automatically determined based on the sourcemap files provided with the transpiled code at runtime. See the [Using the Debugger](#using-the-debugger) section for more information about using the Debug UI. In addition, the exact directory layout of the original source is somewhat flexible, just as it is with the use of non-transpiled code as described in the [Using the Debugger](#using-the-debugger) section.
169
+
141
170
## Limitations and Requirements
142
171
* The root directory of your application needs to contain a `package.json` file.
143
172
* You can set snapshot conditions and watch expressions to be evaluated in the context of your application. This leads to some issues you should be aware of
0 commit comments