2022-05-30 12:46:55 -06:00
|
|
|
const path = require('path');
|
|
|
|
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
2023-06-26 21:08:57 -06:00
|
|
|
const deFaultValues = {
|
2024-10-12 15:28:48 -06:00
|
|
|
PREFIX_URL: ''
|
2023-06-26 21:08:57 -06:00
|
|
|
}
|
2024-10-12 15:28:48 -06:00
|
|
|
const prefixUrl = process.env.PREFIX_URL ? process.env.PREFIX_URL : deFaultValues.PREFIX_URL;
|
|
|
|
|
2022-05-30 12:46:55 -06:00
|
|
|
module.exports = {
|
2024-10-12 15:28:48 -06:00
|
|
|
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
|
|
|
addons: [
|
|
|
|
"@storybook/addon-webpack5-compiler-babel",
|
2023-11-22 09:23:48 -06:00
|
|
|
"@storybook/addon-links",
|
|
|
|
"@storybook/addon-essentials",
|
|
|
|
"@storybook/addon-interactions",
|
|
|
|
{
|
2024-10-12 15:28:48 -06:00
|
|
|
name: '@storybook/addon-styling-webpack',
|
2023-11-22 09:23:48 -06:00
|
|
|
options: {
|
2024-10-12 15:28:48 -06:00
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.(css|sass|scss)$/,
|
|
|
|
use: [
|
|
|
|
'style-loader',
|
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
|
|
|
options: {
|
|
|
|
modules: {
|
|
|
|
namedExport: false,
|
|
|
|
exportLocalsConvention: 'as-is',
|
|
|
|
auto: /\.module\.\w+$/i,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'sass-loader',
|
|
|
|
],
|
2023-11-22 09:23:48 -06:00
|
|
|
}
|
2024-10-12 15:28:48 -06:00
|
|
|
]
|
|
|
|
},
|
2023-11-22 09:23:48 -06:00
|
|
|
}
|
|
|
|
],
|
2024-10-12 15:28:48 -06:00
|
|
|
webpackFinal: async config => {
|
2023-06-26 21:08:57 -06:00
|
|
|
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;
|
|
|
|
}),
|
2023-03-28 17:36:47 -06:00
|
|
|
config.resolve.alias = {
|
|
|
|
...config.resolve.alias,
|
2022-05-30 12:46:55 -06:00
|
|
|
'@components': path.resolve(__dirname, "../src/components/")
|
|
|
|
};
|
|
|
|
config.resolve.plugins = [new TsconfigPathsPlugin()];
|
|
|
|
return config;
|
|
|
|
},
|
2024-10-12 15:28:48 -06:00
|
|
|
framework: {
|
2023-03-28 17:36:47 -06:00
|
|
|
name: "@storybook/react-webpack5",
|
|
|
|
options: {}
|
2022-05-30 12:46:55 -06:00
|
|
|
},
|
|
|
|
typescript: {
|
|
|
|
reactDocgenTypescriptOptions: {
|
|
|
|
compilerOptions: {
|
|
|
|
"paths": {
|
2023-03-28 17:36:47 -06:00
|
|
|
"@Components/*": ["Components/*"]
|
|
|
|
}
|
2022-05-30 12:46:55 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-10-12 15:28:48 -06:00
|
|
|
features: {
|
|
|
|
previewMdx2: true
|
|
|
|
},
|
2023-03-28 17:36:47 -06:00
|
|
|
docs: {
|
|
|
|
autodocs: true
|
|
|
|
}
|
|
|
|
};
|