From 97d51a7763b14c92ee71ff9a012311dd9498d803 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Sun, 8 Aug 2021 00:01:37 +0000 Subject: refactor: path-references refactoring and using 'import' instead of 'require' (#1752) * refactor references to 'userData' and 'appData' directories to move hardcoding into single location * convert to es6 for lower memory usage as per https://codesource.io/the-difference-between-import-and-require-in-javascript/ --- src/components/services/content/ServiceWebview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/services/content') diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index 4edbde5e2..3b499a5db 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { observer } from 'mobx-react'; import { observable, reaction } from 'mobx'; import ElectronWebView from 'react-electron-web-view'; -import path from 'path'; +import { join } from 'path'; import ServiceModel from '../../../models/Service'; @@ -59,7 +59,7 @@ class ServiceWebview extends Component { isSpellcheckerEnabled, } = this.props; - const preloadScript = path.join(__dirname, '../../../', 'webview', 'recipe.js'); + const preloadScript = join(__dirname, '..', '..', '..', 'webview', 'recipe.js'); return (