From 5edf6bbfe6fd23ba83b3a268d179b0f6001098f8 Mon Sep 17 00:00:00 2001 From: Filipp Riabchun Date: Tue, 26 Nov 2019 21:25:00 +0100 Subject: [PATCH] Revert "feat: make frameworkerLoader load both JS and TS loaders as they will be migrated to TS" This reverts commit 83e9b5f1 --- .../storyshots-core/src/frameworks/frameworkLoader.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/addons/storyshots/storyshots-core/src/frameworks/frameworkLoader.ts b/addons/storyshots/storyshots-core/src/frameworks/frameworkLoader.ts index 8bfca595b7a..2a09368902c 100644 --- a/addons/storyshots/storyshots-core/src/frameworks/frameworkLoader.ts +++ b/addons/storyshots/storyshots-core/src/frameworks/frameworkLoader.ts @@ -4,7 +4,7 @@ import path from 'path'; import { Loader } from './Loader'; import { StoryshotsOptions } from '../api/StoryshotsOptions'; -const loaderScriptName = 'loader'; +const loaderScriptName = 'loader.js'; const isDirectory = (source: string) => fs.lstatSync(source).isDirectory(); @@ -13,13 +13,7 @@ function getLoaders(): Loader[] { .readdirSync(__dirname) .map(name => path.join(__dirname, name)) .filter(isDirectory) - .reduce((acc, framework) => { - const filename = path.join(framework, loaderScriptName); - const jsFile = `${filename}.js`; - const tsFile = `${filename}.ts`; - - return acc.concat([jsFile, tsFile]); - }, [] as string[]) + .map(framework => path.join(framework, loaderScriptName)) .filter(fs.existsSync) .map(loader => require(loader).default); }