Skip to content

bspot/phpsourcemaps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Source Maps

(Note that all of this is quick and dirty.)

Generate source maps using PHP.

Usage

Include:

require "SourceMap.php";

Create a new map, giving the name of the file the map is for, as well as the source files:

$map = new SourceMap("outfile.js", array("infile1.js", infile2.js"));

Add mappings:

$map->mappings[] = array(
  'dest_line' => 0, // Line in the compiled file
  'dest_col' => 0, // Column in the compiled file
  'src_index' => 0, // Index of the source file
  'src_line' => 0, // Line in the source file
  'src_col' => 0, // Column in the source file
);

Get JSON representation of the source map:

$json = $map->generateJSON();

About

Generate and read source maps using PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published