Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion code/builders/builder-manager/src/utils/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const renderHTML = async (
refs: Promise<Record<string, Ref>>,
logLevel: Promise<string>,
docsOptions: Promise<DocsOptions>,
{ versionCheck, previewUrl, configType }: Options
{ versionCheck, previewUrl, configType, ignorePreview }: Options
) => {
const titleRef = await title;
const templateRef = await template;
Expand All @@ -54,5 +54,6 @@ export const renderHTML = async (
PREVIEW_URL: JSON.stringify(previewUrl, null, 2), // global preview URL
},
head: (await customHead) || '',
ignorePreview,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you need to update the types and the CLI definitions etc?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which types? and what CLI definitions? This option (ignorePreview) already gets set this just passes it to the manager template.

});
};
2 changes: 2 additions & 0 deletions code/builders/builder-manager/templates/template.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
<% }); %>
</script>

<% if (!ignorePreview) { %>
<link href="./sb-preview/runtime.js" rel="prefetch" as="script" />
<% } %>
Comment thread
tmeasday marked this conversation as resolved.
</body>
</html>
14 changes: 0 additions & 14 deletions code/frameworks/nextjs-server/src/next-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,5 @@ export const withStorybook = ({
destination: `http://localhost:${sbPort}/index.json`,
},
]),
async headers() {
return [
...(config.headers ? await config.headers() : []),
{
source: `/${previewPath}/:path*`,
headers: [
{
key: 'x-frame-options',
value: '',
},
],
},
];
},
});
};