mirror of
https://github.com/morten-olsen/bob-the-algorithm.git
synced 2026-02-08 00:46:25 +01:00
monorepo
This commit is contained in:
58
packages/ui/.storybook/main.js
Normal file
58
packages/ui/.storybook/main.js
Normal file
@@ -0,0 +1,58 @@
|
||||
const path = require('path');
|
||||
const { mergeConfig } = require('vite');
|
||||
|
||||
module.exports = {
|
||||
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
|
||||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
|
||||
framework: '@storybook/react',
|
||||
// core: {
|
||||
// builder: '@storybook/builder-vite',
|
||||
// },
|
||||
typescript: {
|
||||
check: false,
|
||||
checkOptions: {},
|
||||
reactDocgen: 'react-docgen-typescript',
|
||||
reactDocgenTypescriptOptions: {
|
||||
shouldExtractLiteralValuesFromEnum: true,
|
||||
compilerOptions: {
|
||||
allowSyntheticDefaultImports: false,
|
||||
esModuleInterop: false,
|
||||
},
|
||||
}
|
||||
},
|
||||
staticsDirs: ['../public', '../public/assets'],
|
||||
async webpackFinal(config, { configType }) {
|
||||
config.resolve.alias['react-native'] = 'react-native-web';
|
||||
config.module.rules.push({
|
||||
loader: 'babel-loader',
|
||||
test: /\.jsx?$/,
|
||||
options: {
|
||||
presets: ['@babel/preset-env', '@babel/preset-react'],
|
||||
},
|
||||
include: [
|
||||
/node_modules\/.*react-native.*/,
|
||||
],
|
||||
});
|
||||
return config;
|
||||
},
|
||||
async viteFinal(config) {
|
||||
return mergeConfig(config, {
|
||||
optimizeDeps: {
|
||||
esbuildOptions: {
|
||||
loader: {
|
||||
'.js': 'jsx',
|
||||
},
|
||||
},
|
||||
},
|
||||
base: './',
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, '..', 'src'),
|
||||
'react-native': 'react-native-web',
|
||||
},
|
||||
},
|
||||
assetsDir: './public/assets',
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user