mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-18 17:12:53 +03:00
96a53ad765
* refactor: remove mappers * chore: generate graphql types * lint: remove useless import * Remove preset-react-create-app from storybook addons * test: remove old tests * Upgrade storybook version * Remove sb preset-cra and add sb svgr loader * chore: remove figma image url from storybook --------- Co-authored-by: Charles Bochet <charles@twenty.com>
62 lines
1.5 KiB
JavaScript
62 lines
1.5 KiB
JavaScript
const path = require('path');
|
|
|
|
module.exports = {
|
|
webpackFinal: config => {
|
|
config.module.rules.push({
|
|
test: /\.tsx?$/,
|
|
exclude: /node_modules/,
|
|
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');
|
|
config.module.rules.push({
|
|
test: /\.mjs$/,
|
|
include: /node_modules/,
|
|
type: 'javascript/auto'
|
|
});
|
|
config.module.rules.push({
|
|
test: /\.svg$/,
|
|
use: [
|
|
{
|
|
loader: '@svgr/webpack'
|
|
},
|
|
{
|
|
loader: 'file-loader',
|
|
options: {
|
|
name: 'static/media/[path][name].[ext]'
|
|
}
|
|
}
|
|
],
|
|
type: 'javascript/auto',
|
|
issuer: {
|
|
and: [/\.(ts|tsx|js|jsx|md|mdx)$/]
|
|
}
|
|
});
|
|
config.resolve.extensions.push('.mjs');
|
|
config.resolve.alias = {
|
|
...config.resolve.alias,
|
|
'~': path.resolve(__dirname, "../src"),
|
|
'@': path.resolve(__dirname, "../src/modules"),
|
|
};
|
|
return config;
|
|
},
|
|
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
|
addons: [
|
|
"@storybook/addon-links",
|
|
"@storybook/addon-essentials",
|
|
"@storybook/addon-interactions",
|
|
"@storybook/addon-coverage",
|
|
"@storybook/addon-styling"
|
|
|
|
],
|
|
framework: {
|
|
name: '@storybook/react-webpack5',
|
|
options: {}
|
|
},
|
|
}; |