Skip to content

Commit

Permalink
Merge branch '2.0/fix-storybook' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/extension/.storybook/main.js
  • Loading branch information
Thunnini committed Jul 27, 2023
2 parents 436311e + 25012b8 commit f09ace4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
27 changes: 27 additions & 0 deletions packages/extension/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { ProvidePlugin } = require("webpack");

module.exports = {
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: [
Expand All @@ -9,4 +11,29 @@ module.exports = {
core: {
builder: "@storybook/builder-webpack5",
},
webpackFinal: async (config) => {
config.resolve.fallback = {
os: require.resolve("os-browserify/browser"),
buffer: require.resolve("buffer/"),
http: require.resolve("stream-http"),
https: require.resolve("https-browserify"),
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
process: require.resolve("process/browser"),
};

config.module.rules.push({
test: /\.tsx?$/,
loader: "ts-loader",
});

config.plugins.push(
new ProvidePlugin({
process: "process/browser",
Buffer: ["buffer", "Buffer"],
})
);

return config;
},
};
6 changes: 4 additions & 2 deletions packages/extension/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { GlobalStyle } from "../src/styles";
import { ThemeProvider } from "styled-components";
import React from "react";

export const decorators = [
(Story) => (
<>
<ThemeProvider theme={{ mode: "dark" }}>
<GlobalStyle />
<Story />
</>
</ThemeProvider>
),
];

Expand Down

0 comments on commit f09ace4

Please sign in to comment.