Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sourcemap Laravel Package

axy/sourcemap

PHP library to create, load, search, and modify Source Map files. Supports renaming/removing sources, adjusting mappings, handling insert/remove blocks, concatenating maps for concatenated outputs, and merging intermediate maps. Works with maps only, not source/output code.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Eliminates the need to build custom logic for source map manipulation, reducing technical debt and accelerating development.
  • Frontend Debugging & Tooling: Enables seamless integration with frontend build pipelines (e.g., TypeScript, Webpack, Vite) to generate accurate source maps for debugging.
  • Code Optimization & Bundling: Supports advanced use cases like concatenating/minifying JS/CSS files while preserving source map accuracy for stack traces.
  • Legacy System Modernization: Facilitates migration of older systems by retroactively generating source maps for minified assets.
  • Custom Build Tools: Empowers teams to create bespoke build pipelines with granular control over source map transformations (e.g., renaming sources, merging intermediate maps).
  • Error Tracking & Monitoring: Enhances observability by enabling precise error localization in production (e.g., Sentry, Rollbar) for minified assets.

When to Consider This Package

Adopt when:

  • Your PHP backend interacts with frontend build artifacts (e.g., serving minified JS/CSS with source maps).
  • You need to merge, concat, or modify source maps programmatically (e.g., during CI/CD or custom build steps).
  • Debugging minified assets requires accurate stack traces (e.g., in error monitoring tools).
  • You’re building a toolchain for TypeScript, Webpack, or other frontend compilers that generate source maps.
  • Your team lacks expertise in parsing/manipulating .map files manually.

Look elsewhere if:

  • You only need to read source maps (e.g., for static analysis) without modifying them (consider lighter libraries like league/source-mapper).
  • Your use case is JavaScript-centric (e.g., Node.js build tools may offer native solutions).
  • You require real-time source map generation (e.g., during runtime) rather than static manipulation.
  • Your project uses non-standard source map formats (e.g., custom extensions).
  • The team lacks PHP expertise to integrate the package into existing pipelines.

How to Pitch It (Stakeholders)

For Executives: *"This package lets us programmatically manipulate JavaScript/CSS source maps—critical for debugging minified code in production. It enables us to:

  • Accelerate frontend builds by automating source map concatenation/merging (e.g., for TypeScript/Webpack pipelines).
  • Improve error tracking by ensuring stack traces point to original source files, not minified assets.
  • Reduce technical debt by avoiding custom scripts for source map handling. Investment: Low (MIT-licensed, PHP-based). ROI: Faster releases, better debugging, and scalable tooling."

For Engineering: *"axy/sourcemap is a battle-tested PHP library for source map manipulation, offering:

  • Core features: Create, load, modify, concat, and merge .map files.
  • Precision tools: Search positions, rename sources, remove blocks, and handle edge cases (e.g., zero-based offsets).
  • Integration-ready: Works with existing build tools (e.g., TypeScript, Webpack) and error trackers (Sentry). Why not roll our own?
  • Maintenance: Actively documented with tests/coverage.
  • Performance: Optimized for large-scale builds.
  • Flexibility: Supports intermediate source map merging (e.g., TS → JS → minified → final map). Use cases: Custom build steps, legacy system upgrades, or tooling for frontend-heavy apps."*

For Developers: *"Need to hack source maps in PHP? This library handles the gritty details:

  • Concatenation: Merge multiple .map files into one (e.g., for bundled JS).
  • Merging: Chain intermediate maps (e.g., TS → JS → minified) to point back to original sources.
  • Search/Modify: Find positions, rename sources, or strip debug info—all via a clean API. Example: Automate source map updates in CI when minifying assets for production. Pro tip: Clone source maps before modifying them to avoid side effects."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
craftcms/url-validator
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony