Skip to content

Commit

Permalink
feat: enable sourcemap by default
Browse files Browse the repository at this point in the history
  • Loading branch information
szkiba committed Apr 12, 2024
1 parent a1e86e4 commit 25ebe81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export default () => {

xk6-ts can be disabled by setting the `XK6_TS` environment variable to `false`.

During the development of the test script, it is recommended to set the `XK6_TS_SOURCEMAP` environment variable to `true`. Thus, the runtime error messages will report the correct source code position. Otherwise, due to transpilation and bundling, the source code position is meaningless.
To ensure that runtime error messages report the correct source code position, sourcemap generation is enabled by default. Otherwise, due to transpilation and bundling, the source code position is meaningless.
Sourcemap generation can be disabled by setting the value of the `XK6_TS_SOURCEMAP` environment variable to `false`.

## Features

Expand Down
2 changes: 1 addition & 1 deletion loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func redirectStdin() {

opts := &k6pack.Options{
Filename: filename,
SourceMap: os.Getenv("XK6_TS_SOURCEMAP") == "true",
SourceMap: os.Getenv("XK6_TS_SOURCEMAP") != "false",
}

source, err := os.ReadFile(filepath.Clean(filename))
Expand Down

0 comments on commit 25ebe81

Please sign in to comment.