Skip to content

Commit 009399c

Browse files
authored
Structuring all the same data that went into patternlab-data.js and putting it into patternlab-data.json too (#161)
1 parent 46ae845 commit 009399c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/PatternLab/Builder.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,16 @@ protected function generateIndex() {
211211

212212
// write out the data
213213
file_put_contents($dataDir."/patternlab-data.js",$output);
214+
// Structuring all the same data that went into `patternlab-data.js` and putting it into `patternlab-data.json` too
215+
$allPlData = array(
216+
'config' => $config,
217+
'ishControls' => $ishControls,
218+
'navItems' => $navItems,
219+
'patternPaths' => $patternPaths,
220+
'viewAllPaths' => $viewAllPaths,
221+
'plugins' => $packagesInfo,
222+
);
223+
file_put_contents($dataDir."/patternlab-data.json", json_encode($allPlData));
214224

215225
// note the end of the operation
216226
$dispatcherInstance->dispatch("builder.generateIndexEnd");

0 commit comments

Comments
 (0)