Skip to content

Commit

Permalink
Merge branch '42shadow42-mjs-jsx-tsx-raw-support' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Nov 28, 2023
2 parents dda0507 + 2620af4 commit d932d4f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
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

0 comments on commit d932d4f

Please sign in to comment.