Skip to content

Remove k6pack dependency in favor of k6's native TypeScript support #912

@jalevin

Description

@jalevin

Background

github.com/grafana/k6pack (previously github.com/szkiba/k6pack) is now archived (October 2025). It was a TypeScript transpiler/bundler for k6, but its functionality has been superseded by k6's built-in esbuild pipeline introduced in k6 v1.4.0.

Since we use grafana/k6:latest (currently v1.6.x), k6 can now run .ts files directly via k6 run script.ts without any external transpilation step.

What needs to change

In pkg/executor/k6/k6_executor.go:

  • Remove the transpileTest() function (lines ~298-325) which calls k6pack.Pack() to transpile TypeScript to a temp JS file
  • In execTest(), remove the transpileTest() call and pass testFile directly to prepareK6Command()
  • Remove the "github.com/szkiba/k6pack" import

In go.mod / go.sum:

  • Remove github.com/szkiba/k6pack

Why now

PR #836 (Renovate) attempted to bump k6pack from v0.1.3v0.2.4, but v0.2.4 renamed the module path to github.com/grafana/k6pack and the package is archived with no future updates. We patched it with option 2 (import path update) as a short-term fix, but the right long-term solution is to remove the dependency entirely.

Acceptance criteria

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions