We need to ensure that our components are accessible. In order to ease this task, we decide to install this package to display an a11y report for each component into the storybook interface. In this way, developer can check if the component it is developing violates or miss so a11y rules.
34 lines
790 B
JavaScript
34 lines
790 B
JavaScript
const viteTsconfig = require('vite-tsconfig-paths');
|
|
const tsconfigPaths = viteTsconfig.default;
|
|
const { mergeConfig } = require('vite');
|
|
|
|
module.exports = {
|
|
'stories': [
|
|
'../src/**/*.stories.mdx',
|
|
'../src/**/*.stories.@(js|jsx|ts|tsx)',
|
|
],
|
|
'addons': [
|
|
'@storybook/addon-links',
|
|
'@storybook/addon-essentials',
|
|
'@storybook/addon-interactions',
|
|
'@storybook/addon-a11y',
|
|
],
|
|
'framework': '@storybook/react',
|
|
'core': {
|
|
'builder': '@storybook/builder-vite',
|
|
},
|
|
staticDirs: [
|
|
'../src',
|
|
],
|
|
'features': {
|
|
'storyStoreV7': true,
|
|
},
|
|
async viteFinal(config) {
|
|
const finalConfig = mergeConfig(config, {
|
|
plugins: [tsconfigPaths()],
|
|
});
|
|
finalConfig.base = 'https://openfun.github.io/cunningham';
|
|
return finalConfig;
|
|
},
|
|
};
|