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
7 changes: 7 additions & 0 deletions code/addons/docs/template/stories/stories-mdx/RawSource.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React, { Fragment } from 'react';

export const MY_VALUE_I_WANT_TO_SHOW_IN_STORY = 'Hello World!';

export const RawSource = () => {
return <Fragment>{MY_VALUE_I_WANT_TO_SHOW_IN_STORY}</Fragment>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { RawSource as RawSourceComponent } from './RawSource.jsx';
// eslint-disable-next-line import/no-unresolved
import RawSourceCode from './RawSource.jsx?raw';

export const RawSource = RawSourceComponent.bind({});

RawSource.parameters = {
docs: {
source: {
code: RawSourceCode,
language: 'tsx',
type: 'code',
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs';
import * as stories from './raw-source.non-stories';
import { RawSource } from './RawSource';

<Meta component={RawSource} />

<Canvas>
<Story story={stories.RawSource} />
</Canvas>
1 change: 1 addition & 0 deletions code/builders/builder-webpack5/src/preview/loaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const createBabelLoader = async (
options: babelOptions,
},
],
resourceQuery: { not: [/raw/] },
include: [getProjectRoot()],
exclude: [/node_modules/, ...excludes],
};
Expand Down