diff --git a/README.md b/README.md index 128edb4..616e2c8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/loader.go b/loader.go index 91a8c54..305c680 100644 --- a/loader.go +++ b/loader.go @@ -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))