From 71877bb01eef93a9c7588452dd7801bf85c6c4d6 Mon Sep 17 00:00:00 2001 From: Jon Palmer Date: Fri, 27 Dec 2019 11:48:06 -0500 Subject: [PATCH] Cleanup from PR --- app/server/package.json | 1 - app/server/src/client/preview/render.ts | 11 +++++++++++ .../src/server/framework-preset-server.ts | 18 +----------------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/app/server/package.json b/app/server/package.json index 61045fff655b..4476b5454681 100644 --- a/app/server/package.json +++ b/app/server/package.json @@ -38,7 +38,6 @@ "@types/webpack-env": "^1.13.9", "core-js": "^3.0.1", "global": "^4.3.2", - "html-loader": "^0.5.5", "regenerator-runtime": "^0.13.3", "ts-dedent": "^1.1.0" }, diff --git a/app/server/src/client/preview/render.ts b/app/server/src/client/preview/render.ts index 67981c13ef5f..c9e9b41b940b 100644 --- a/app/server/src/client/preview/render.ts +++ b/app/server/src/client/preview/render.ts @@ -17,6 +17,17 @@ export default async function renderMain({ }: RenderMainArgs) { const params = storyFn(); + if (fetchStoryHtml === undefined) { + showError({ + title: `Expecting fetchStoryHtml to be configured for @storybook/server.`, + description: dedent` + Did you forget to pass a fetchStoryHtml function to configure? + Use "configure(() => stories, module, { fetchStoryHtml: yourFetchHtmlFunction });". + `, + }); + return; + } + const element = await fetchStoryHtml(id, params); showMain(); diff --git a/app/server/src/server/framework-preset-server.ts b/app/server/src/server/framework-preset-server.ts index a3b4185d0a1a..99c260139df1 100644 --- a/app/server/src/server/framework-preset-server.ts +++ b/app/server/src/server/framework-preset-server.ts @@ -2,21 +2,5 @@ import { Configuration } from 'webpack'; export function webpack(config: Configuration) { - return { - ...config, - module: { - ...config.module, - rules: [ - ...config.module.rules, - { - test: /\.html$/, - use: [ - { - loader: require.resolve('html-loader'), - }, - ], - }, - ], - }, - }; + return config; }