From 1e862d7f28bbcce159e3c75eee8069e059f95563 Mon Sep 17 00:00:00 2001 From: dleffler Date: Wed, 20 Dec 2017 09:08:18 -0500 Subject: [PATCH 1/3] Fix/restore working source map generation in 0.7.3 --- src/SourceMap/SourceMapGenerator.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/SourceMap/SourceMapGenerator.php b/src/SourceMap/SourceMapGenerator.php index cbfaa7cf..3a55851a 100644 --- a/src/SourceMap/SourceMapGenerator.php +++ b/src/SourceMap/SourceMapGenerator.php @@ -174,9 +174,17 @@ public function generateJson() $root = $this->options['sourceRoot']; if ($root) { +// $sourceMap['sourceRoot'] = $root; + // A list of symbol names used by the 'mappings' entry. $sourceMap['names'] = array(); } + // A list of original sources used by the 'mappings' entry. + $sourceMap['sources'] = array(); + foreach($this->sources as $source_uri => $source_filename) { + $sourceMap['sources'][] = $this->normalizeFilename($source_filename); + } + // A string with the encoded mapping data. $sourceMap['mappings'] = $mappings; From e8e4df7c5447165638ac255bd86a08b093bc9fb0 Mon Sep 17 00:00:00 2001 From: dleffler Date: Wed, 20 Dec 2017 16:03:15 -0500 Subject: [PATCH 2/3] Regression fix last push to fix 0.7.3 source maps --- src/SourceMap/SourceMapGenerator.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/SourceMap/SourceMapGenerator.php b/src/SourceMap/SourceMapGenerator.php index 3a55851a..c0f96dab 100644 --- a/src/SourceMap/SourceMapGenerator.php +++ b/src/SourceMap/SourceMapGenerator.php @@ -172,11 +172,9 @@ public function generateJson() // An optional source root, useful for relocating source files on a server or removing repeated values in the // 'sources' entry. This value is prepended to the individual entries in the 'source' field. $root = $this->options['sourceRoot']; - if ($root) { -// $sourceMap['sourceRoot'] = $root; + $sourceMap['sourceRoot'] = $root; // A list of symbol names used by the 'mappings' entry. - $sourceMap['names'] = array(); } // A list of original sources used by the 'mappings' entry. @@ -184,6 +182,7 @@ public function generateJson() foreach($this->sources as $source_uri => $source_filename) { $sourceMap['sources'][] = $this->normalizeFilename($source_filename); } + $sourceMap['names'] = array(); // A string with the encoded mapping data. $sourceMap['mappings'] = $mappings; From 045f3087bcb7a293ca2f6da02109fa17d20834a5 Mon Sep 17 00:00:00 2001 From: Anthon Pang Date: Wed, 20 Dec 2017 19:17:12 -0500 Subject: [PATCH 3/3] Update SourceMapGenerator.php --- src/SourceMap/SourceMapGenerator.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/SourceMap/SourceMapGenerator.php b/src/SourceMap/SourceMapGenerator.php index c0f96dab..08e06168 100644 --- a/src/SourceMap/SourceMapGenerator.php +++ b/src/SourceMap/SourceMapGenerator.php @@ -172,16 +172,19 @@ public function generateJson() // An optional source root, useful for relocating source files on a server or removing repeated values in the // 'sources' entry. This value is prepended to the individual entries in the 'source' field. $root = $this->options['sourceRoot']; + if ($root) { $sourceMap['sourceRoot'] = $root; - // A list of symbol names used by the 'mappings' entry. } // A list of original sources used by the 'mappings' entry. $sourceMap['sources'] = array(); - foreach($this->sources as $source_uri => $source_filename) { + + foreach ($this->sources as $source_uri => $source_filename) { $sourceMap['sources'][] = $this->normalizeFilename($source_filename); } + + // A list of symbol names used by the 'mappings' entry. $sourceMap['names'] = array(); // A string with the encoded mapping data.