Skip to content

Commit

Permalink
Merge pull request #7845 from enagy27/addon-docs/ts-source-fix
Browse files Browse the repository at this point in the history
Source-loader: Selectively ignore typescript errors in generated code
  • Loading branch information
shilman authored Aug 23, 2019
2 parents 05b1df9 + 0be1902 commit 6a414d9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/source-loader/src/server/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,22 @@ export function transform(inputSource) {
localDependencies,
idsToFrameworks,
}) => `
// @ts-ignore-start
// @ts-ignore
var withSourceLoader = require('@storybook/source-loader/preview').withSource;
// @ts-ignore
var __SOURCE_PREFIX__ = "${prefix.replace(/\\([^\\ ])/g, '\\\\$1')}";
// @ts-ignore
var __STORY__ = ${sourceJson};
// @ts-ignore
var __ADDS_MAP__ = ${JSON.stringify(addsMap)};
// @ts-ignore
var __MAIN_FILE_LOCATION__ = ${JSON.stringify(resource)};
// @ts-ignore
var __MODULE_DEPENDENCIES__ = ${JSON.stringify(dependencies)};
// @ts-ignore
var __LOCAL_DEPENDENCIES__ = ${JSON.stringify(localDependencies)};
// @ts-ignore
var __IDS_TO_FRAMEWORKS__ = ${JSON.stringify(idsToFrameworks)};
// @ts-ignore-end
${source}
`
Expand Down

1 comment on commit 6a414d9

@vercel
Copy link

@vercel vercel bot commented on 6a414d9 Aug 23, 2019

Choose a reason for hiding this comment

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

Please sign in to comment.