From a95314237776aa596c958c367c08f055ee715734 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Sun, 15 Jan 2023 02:03:16 +0100 Subject: [PATCH] Import store modules with ES6 imports instead of dynamically (#3064) --- src/renderer/store/modules/index.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/renderer/store/modules/index.js b/src/renderer/store/modules/index.js index 33063f6f3990..d556d9571d6e 100644 --- a/src/renderer/store/modules/index.js +++ b/src/renderer/store/modules/index.js @@ -1,14 +1,22 @@ /** * The file enables `@/store/index.js` to import all vuex modules - * in a one-shot manner. There should not be any reason to edit this file. + * in a one-shot manner. */ -const files = require.context('.', false, /\.js$/) -const modules = {} +import history from './history' +import invidious from './invidious' +import playlists from './playlists' +import profiles from './profiles' +import settings from './settings' +import subscriptions from './subscriptions' +import utils from './utils' -files.keys().forEach(key => { - if (key === './index.js') return - modules[key.replaceAll(/(\.\/|\.js)/g, '')] = files(key).default -}) - -export default modules +export default { + history, + invidious, + playlists, + profiles, + settings, + subscriptions, + utils +}