From 11e99b53b87e8d444f2c251bf2332c6efa4657f9 Mon Sep 17 00:00:00 2001
From: Ray Schamp <rschamp@users.noreply.github.com>
Date: Thu, 9 Aug 2018 13:36:22 -0400
Subject: [PATCH] Revert "build dist, even when run without
 NODE_ENV=production"

---
 webpack.config.js | 71 ++++++++++++++++++++++++-----------------------
 1 file changed, 36 insertions(+), 35 deletions(-)

diff --git a/webpack.config.js b/webpack.config.js
index 0fea3d810..a44d90c48 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -177,41 +177,42 @@ module.exports = [
         ])
     })
 ].concat(
-    // export as library
-    defaultsDeep({}, base, {
-        target: 'web',
-        entry: {
-            'scratch-gui': './src/index.js'
-        },
-        output: {
-            libraryTarget: 'umd',
-            path: path.resolve('dist')
-        },
-        externals: {
-            React: 'react',
-            ReactDOM: 'react-dom'
-        },
-        module: {
-            rules: base.module.rules.concat([
-                {
-                    test: /\.(svg|png|wav|gif|jpg)$/,
-                    loader: 'file-loader',
-                    options: {
-                        outputPath: 'static/assets/',
-                        publicPath: '/static/assets/'
+    process.env.NODE_ENV === 'production' ? (
+        // export as library
+        defaultsDeep({}, base, {
+            target: 'web',
+            entry: {
+                'scratch-gui': './src/index.js'
+            },
+            output: {
+                libraryTarget: 'umd',
+                path: path.resolve('dist')
+            },
+            externals: {
+                React: 'react',
+                ReactDOM: 'react-dom'
+            },
+            module: {
+                rules: base.module.rules.concat([
+                    {
+                        test: /\.(svg|png|wav|gif|jpg)$/,
+                        loader: 'file-loader',
+                        options: {
+                            outputPath: 'static/assets/',
+                            publicPath: '/static/assets/'
+                        }
                     }
-                }
+                ])
+            },
+            plugins: base.plugins.concat([
+                new CopyWebpackPlugin([{
+                    from: 'node_modules/scratch-blocks/media',
+                    to: 'static/blocks-media'
+                }]),
+                new CopyWebpackPlugin([{
+                    from: 'extension-worker.{js,js.map}',
+                    context: 'node_modules/scratch-vm/dist/web'
+                }])
             ])
-        },
-        plugins: base.plugins.concat([
-            new CopyWebpackPlugin([{
-                from: 'node_modules/scratch-blocks/media',
-                to: 'static/blocks-media'
-            }]),
-            new CopyWebpackPlugin([{
-                from: 'extension-worker.{js,js.map}',
-                context: 'node_modules/scratch-vm/dist/web'
-            }])
-        ])
-    })
+        })) : []
 );
-- 
GitLab