From 0910970800d12bd295a932e8a9a76e7294ebbfac Mon Sep 17 00:00:00 2001
From: Ray Schamp <ray@scratch.mit.edu>
Date: Fri, 9 Jun 2017 16:24:00 -0400
Subject: [PATCH] Don't require BASE_PATH env variable for builds

It wasn't ever necessary. Still allow configuring this path in the GUI in case of different paths to static files for scratch-blocks.
---
 src/components/gui/gui.jsx | 2 +-
 src/index.jsx              | 8 +-------
 webpack.config.js          | 1 -
 3 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx
index 47fb1b327..6d0bb59dc 100644
--- a/src/components/gui/gui.jsx
+++ b/src/components/gui/gui.jsx
@@ -119,6 +119,6 @@ GUIComponent.propTypes = {
     vm: PropTypes.instanceOf(VM).isRequired
 };
 GUIComponent.defaultProps = {
-    basePath: '/'
+    basePath: './'
 };
 module.exports = GUIComponent;
diff --git a/src/index.jsx b/src/index.jsx
index 80917de85..1c9a61f90 100644
--- a/src/index.jsx
+++ b/src/index.jsx
@@ -1,4 +1,3 @@
-const PropTypes = require('prop-types');
 const React = require('react');
 const ReactDOM = require('react-dom');
 const {Provider} = require('react-redux');
@@ -52,17 +51,12 @@ class App extends React.Component {
         if (this.state.projectData === null) return null;
         return (
             <GUI
-                basePath={this.props.basePath}
                 projectData={this.state.projectData}
             />
         );
     }
 }
 
-App.propTypes = {
-    basePath: PropTypes.string
-};
-
 const appTarget = document.createElement('div');
 appTarget.className = styles.app;
 document.body.appendChild(appTarget);
@@ -74,6 +68,6 @@ const store = applyMiddleware(
 );
 ReactDOM.render((
     <Provider store={store}>
-        <App basePath={process.env.BASE_PATH} />
+        <App />
     </Provider>
 ), appTarget);
diff --git a/webpack.config.js b/webpack.config.js
index 409bb72a2..532ff10cb 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -75,7 +75,6 @@ module.exports = {
     plugins: [
         new webpack.DefinePlugin({
             'process.env.NODE_ENV': '"' + process.env.NODE_ENV + '"',
-            'process.env.BASE_PATH': '"' + (process.env.BASE_PATH || '/') + '"',
             'process.env.DEBUG': Boolean(process.env.DEBUG)
         }),
         new webpack.optimize.CommonsChunkPlugin({
-- 
GitLab