mix posthog.package_source_code (posthog v2.6.0)
View SourcePackages source code into a binary file for source context in error tracking.
This task reads all .ex source files from the configured root paths and
writes a compressed binary into PostHog's own priv/ directory. This file
is then bundled into the release and loaded at runtime to provide source
context in stack traces.
Run this task before building a release:
mix posthog.package_source_code
mix releaseOptions
--output- Custom output path (default: PostHog's priv dir)--root-path- Root source code path(s). Can be specified multiple times. Defaults to the current working directory.
Configuration
This task reads the following from your application config:
config :posthog,
root_source_code_paths: [File.cwd!()],
source_code_path_pattern: "**/*.ex",
source_code_exclude_patterns: [~r"^_build/", ~r"^priv/", ~r"^test/"]CLI options override config values.