From 6eaf6312b9e1fcb3b36ac4256bc0866336417e0f Mon Sep 17 00:00:00 2001
From: Paul Kaplan <pkaplan@media.mit.edu>
Date: Fri, 1 Nov 2019 10:51:52 -0400
Subject: [PATCH] Include library JSON files in package distribution

Files like src/lib/libraries/sprites.json were being used by
packages like scratch-desktop in order to fetch all the library
assets for offline access. We stopped publishing src in #5263 to
stop bloating the dist with copies of src files. Explicitly
exporting the files that are needed by other repos is a better
long-term plan.

The files are now published to dist/libraries/*.json. Once this is
merged those repos that use the src/ path need to change it to e.g.
`require('scratch-gui/dist/libraries/backdrops.json')`
---
 webpack.config.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/webpack.config.js b/webpack.config.js
index b134cd090..283d65706 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -219,6 +219,12 @@ module.exports = [
                 new CopyWebpackPlugin([{
                     from: 'extension-worker.{js,js.map}',
                     context: 'node_modules/scratch-vm/dist/web'
+                }]),
+                // Include library JSON files for scratch-desktop to use for downloading
+                new CopyWebpackPlugin([{
+                    from: 'src/lib/libraries/*.json',
+                    to: 'libraries',
+                    flatten: true
                 }])
             ])
         })) : []
-- 
GitLab