2023-06-04 12:23:09 +03:00
|
|
|
const path = require('path');
|
|
|
|
|
2022-12-05 00:59:30 +03:00
|
|
|
module.exports = {
|
2023-04-11 00:31:55 +03:00
|
|
|
webpackFinal: config => {
|
2022-12-05 00:59:30 +03:00
|
|
|
config.module.rules.push({
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
exclude: /node_modules/,
|
2023-04-11 00:31:55 +03:00
|
|
|
use: [{
|
|
|
|
loader: require.resolve('babel-loader'),
|
|
|
|
options: {
|
|
|
|
presets: [require('@babel/preset-typescript').default, [require('@babel/preset-react').default, {
|
|
|
|
runtime: 'automatic'
|
|
|
|
}], require('@babel/preset-env').default]
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
config.resolve.extensions.push('.ts', '.tsx');
|
2022-12-05 00:59:30 +03:00
|
|
|
config.module.rules.push({
|
|
|
|
test: /\.mjs$/,
|
|
|
|
include: /node_modules/,
|
2023-04-11 00:31:55 +03:00
|
|
|
type: 'javascript/auto'
|
|
|
|
});
|
|
|
|
config.resolve.extensions.push('.mjs');
|
2023-06-04 12:23:09 +03:00
|
|
|
config.resolve.alias = {
|
|
|
|
...config.resolve.alias,
|
|
|
|
'~': path.resolve(__dirname, "../src"),
|
|
|
|
'@': path.resolve(__dirname, "../src/modules"),
|
|
|
|
};
|
2023-04-11 00:31:55 +03:00
|
|
|
return config;
|
2022-12-05 00:59:30 +03:00
|
|
|
},
|
2023-05-29 12:02:38 +03:00
|
|
|
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
|
|
|
addons: [
|
|
|
|
"@storybook/addon-links",
|
|
|
|
"@storybook/addon-essentials",
|
|
|
|
"@storybook/addon-interactions",
|
|
|
|
"@storybook/preset-create-react-app",
|
|
|
|
"@storybook/addon-coverage"
|
|
|
|
],
|
2023-04-11 00:31:55 +03:00
|
|
|
framework: {
|
|
|
|
name: '@storybook/react-webpack5',
|
|
|
|
options: {}
|
|
|
|
},
|
|
|
|
};
|