mirror of
https://github.com/aleleba/react-list-ui-library.git
synced 2025-06-20 00:38:15 -06:00
Initial commit
This commit is contained in:
43
.storybook/main.js
Normal file
43
.storybook/main.js
Normal file
@ -0,0 +1,43 @@
|
||||
const path = require('path');
|
||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||
const deFaultValues = {
|
||||
PREFIX_URL: ''
|
||||
}
|
||||
const prefixUrl = process.env.PREFIX_URL ? process.env.PREFIX_URL : deFaultValues.PREFIX_URL
|
||||
module.exports = {
|
||||
"stories": ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
||||
"addons": ["@storybook/addon-links", "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/preset-scss"],
|
||||
"webpackFinal": async config => {
|
||||
config.entry = config.entry.map(function(entry) {
|
||||
if (entry.includes("webpack-hot-middleware")) {
|
||||
return `${require.resolve('webpack-hot-middleware/client')}?path=${prefixUrl}__webpack_hmr&reload=true`;
|
||||
}
|
||||
return entry;
|
||||
}),
|
||||
config.resolve.alias = {
|
||||
...config.resolve.alias,
|
||||
'@components': path.resolve(__dirname, "../src/components/")
|
||||
};
|
||||
config.resolve.plugins = [new TsconfigPathsPlugin()];
|
||||
return config;
|
||||
},
|
||||
"framework": {
|
||||
name: "@storybook/react-webpack5",
|
||||
options: {}
|
||||
},
|
||||
typescript: {
|
||||
reactDocgenTypescriptOptions: {
|
||||
compilerOptions: {
|
||||
"paths": {
|
||||
"@Components/*": ["Components/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
features: {
|
||||
previewMdx2: true
|
||||
},
|
||||
docs: {
|
||||
autodocs: true
|
||||
}
|
||||
};
|
9
.storybook/preview.js
Normal file
9
.storybook/preview.js
Normal file
@ -0,0 +1,9 @@
|
||||
export const parameters = {
|
||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/,
|
||||
},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user