Anvil/.storybook/main.ts
André Jaenisch 07007b0016
chore: add license banner to stories
I dropped the examples while at it.
Since Svelte-Octicons are used as-is I have to declare the license as
MIT.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2024-07-04 08:21:35 +02:00

56 lines
1.7 KiB
TypeScript

/* Configuration of Storybook.
* Copyright (C) 2024 André Jaenisch
* SPDX-FileCopyrightText: 2024 André Jaenisch
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { dirname, join, resolve } from 'node:path';
import type { StorybookConfig } from '@storybook/sveltekit';
import { mergeConfig } from 'vite';
const config: StorybookConfig = {
stories: ['../stories/**/*.mdx', '../stories/**/*.stories.ts'],
addons: [
'@storybook/addon-a11y',
'@storybook/addon-essentials',
'@storybook/addon-links',
'@storybook/addon-interactions',
'@storybook/addon-toolbar'
],
core: {
disableTelemetry: true
},
framework: {
name: '@storybook/sveltekit',
options: {}
},
docs: {
autodocs: 'tag'
},
async viteFinal(config) {
const allowFiles = config.server?.fs?.allow || [];
const storyFiles = resolve('stories');
return mergeConfig(config, {
alias: {
...config.alias,
$lib: resolve('..', 'src', 'lib')
},
server: {
...config.server,
fs: {
...config.server?.fs,
allow: [...allowFiles, storyFiles]
}
}
});
}
};
export default config;