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
description: 'Resolve the path to a URL string in the same way an import statement does.'
4
+
---
5
+
6
+
# resolve( path )
7
+
8
+
Resolve a path to a URL string in the same way an import statement does.'
9
+
10
+
This is useful if you want to provide a path relative to the current module to a function that uses `open` or another function that takes URLs.
11
+
12
+
This is particularly useful as some functions within k6 are not relative to the same origin, which might lead to seemingly similar paths having different files being loaded from the filesystem.
13
+
14
+
For more details, refer to this [issue](https://github.com/grafana/k6/issues/3857).
|[import.meta.resolve](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/import.meta/resolve)| resolve path to URL the same way that an ESM import would |
0 commit comments