From 49b4e1f2b3220dcd93255ea171cccfe40d1fa802 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Tue, 27 Jul 2021 17:35:14 +0200 Subject: [PATCH] fix: remove HOME_PATH (#43034) It was only used as a default for hardGoTo, but that function is only called once and does not need the default --- client/gatsby-node.js | 7 +------ client/src/redux/hard-go-to-epic.js | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/client/gatsby-node.js b/client/gatsby-node.js index 243ad2c671..86e3ad012d 100644 --- a/client/gatsby-node.js +++ b/client/gatsby-node.js @@ -167,13 +167,8 @@ exports.createPages = function createPages({ graphql, actions, reporter }) { const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); -exports.onCreateWebpackConfig = ({ stage, plugins, actions }) => { +exports.onCreateWebpackConfig = ({ stage, actions }) => { const newPlugins = [ - plugins.define({ - HOME_PATH: JSON.stringify( - process.env.HOME_PATH || 'http://localhost:3000' - ) - }), // We add the shims of the node globals to the global scope new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] diff --git a/client/src/redux/hard-go-to-epic.js b/client/src/redux/hard-go-to-epic.js index 89bee5db51..300f4e31c6 100644 --- a/client/src/redux/hard-go-to-epic.js +++ b/client/src/redux/hard-go-to-epic.js @@ -1,4 +1,3 @@ -/* global HOME_PATH */ import { ofType } from 'redux-observable'; import { tap, ignoreElements } from 'rxjs/operators'; @@ -7,7 +6,7 @@ import { types } from './'; export default function hardGoToEpic(action$, _, { location }) { return action$.pipe( ofType(types.hardGoTo), - tap(({ payload = HOME_PATH }) => { + tap(({ payload }) => { location.href = payload; }), ignoreElements()