Skip to content

Commit

Permalink
Cleanup from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Palmer committed Dec 27, 2019
1 parent 7145e09 commit 71877bb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
1 change: 0 additions & 1 deletion app/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
11 changes: 11 additions & 0 deletions app/server/src/client/preview/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
18 changes: 1 addition & 17 deletions app/server/src/server/framework-preset-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 71877bb

Please sign in to comment.