This repository has been archived by the owner on Feb 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client): initial storybook/jest setup
Roll back to Webpack 4 because Storybook does not support Webpack 5 for the near future (see storybookjs/storybook#11326 (comment)). Use @storybook/react (which includes React as a dependency) instead of Preact because the Storybook build breaks when using theme-ui (most likely because of the bundled React dependency).
- Loading branch information
Showing
5 changed files
with
5,302 additions
and
667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
presets: [ | ||
['@babel/preset-typescript', { | ||
isTSX: true, | ||
allExtensions: true | ||
}], | ||
['@babel/preset-react', { | ||
pragma: 'jsx', | ||
pragmaFrag: 'Fragment' | ||
}], | ||
['@babel/preset-env', { | ||
targets: { esmodules: true } | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const webpack = require('webpack') | ||
|
||
module.exports = { | ||
stories: ['../src/**/*.stories.tsx'], | ||
webpackFinal: config => { | ||
config.plugins.push( | ||
new webpack.ProvidePlugin({ | ||
jsx: ['theme-ui', 'jsx'], | ||
Fragment: ['react', 'Fragment'] | ||
}) | ||
) | ||
|
||
return config | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.