mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
dec9f4a0c1
We need to patch some security issues with version updates, but Storybook dependencies currently block them. This updates Storybook and all addons to the latest version. I test building and serving Storybook locally and no issues.
77 lines
1.9 KiB
TypeScript
77 lines
1.9 KiB
TypeScript
const path = require("path");
|
|
const bourbon = require("node-bourbon").includePaths;
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
|
const globImporter = require("node-sass-glob-importer");
|
|
|
|
import type { StorybookConfig } from "@storybook/react-webpack5";
|
|
|
|
const config: StorybookConfig = {
|
|
webpackFinal: async (config) => {
|
|
config.module?.rules?.push({
|
|
test: /\.scss$/,
|
|
use: [
|
|
{
|
|
loader: MiniCssExtractPlugin.loader,
|
|
options: {
|
|
publicPath: "./",
|
|
},
|
|
},
|
|
{
|
|
loader: "css-loader",
|
|
},
|
|
{
|
|
loader: "postcss-loader",
|
|
},
|
|
{
|
|
loader: "sass-loader",
|
|
options: {
|
|
sourceMap: true,
|
|
sassOptions: {
|
|
includePaths: bourbon,
|
|
importer: globImporter(),
|
|
},
|
|
},
|
|
},
|
|
],
|
|
});
|
|
config.plugins?.push(
|
|
new MiniCssExtractPlugin({
|
|
filename: "[name].css",
|
|
})
|
|
);
|
|
config.resolve?.modules?.push(path.resolve(__dirname, "../frontend"));
|
|
return config;
|
|
},
|
|
stories: [
|
|
"../frontend/components/**/*.stories.mdx",
|
|
"../frontend/components/**/*.stories.@(js|jsx|ts|tsx)",
|
|
],
|
|
addons: [
|
|
"@storybook/addon-links",
|
|
"@storybook/addon-essentials",
|
|
"@storybook/addon-mdx-gfm",
|
|
"@storybook/addon-a11y",
|
|
"@storybook/test-runner",
|
|
"@storybook/addon-designs",
|
|
],
|
|
typescript: {
|
|
check: false,
|
|
reactDocgen: "react-docgen-typescript",
|
|
reactDocgenTypescriptOptions: {
|
|
shouldExtractLiteralValuesFromEnum: true,
|
|
propFilter: (prop) =>
|
|
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
|
|
shouldRemoveUndefinedFromOptional: true,
|
|
},
|
|
},
|
|
framework: {
|
|
name: "@storybook/react-webpack5",
|
|
options: {},
|
|
},
|
|
docs: {
|
|
autodocs: true,
|
|
},
|
|
};
|
|
|
|
export default config;
|