mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
feat: 增加 storybook
This commit is contained in:
parent
8d7ae405a6
commit
0520af8466
21 changed files with 9127 additions and 104 deletions
36
packages/web/.storybook/main.js
Normal file
36
packages/web/.storybook/main.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
const { mergeConfig } = require('vite')
|
||||
const { join } = require('path')
|
||||
const { createSvgIconsPlugin } = require('vite-plugin-svg-icons')
|
||||
console.log(join(__dirname, '../assets/icons'))
|
||||
|
||||
module.exports = {
|
||||
stories: [
|
||||
'../components/**/*.stories.mdx',
|
||||
'../components/**/*.stories.@(js|jsx|ts|tsx)',
|
||||
],
|
||||
addons: [
|
||||
'@storybook/addon-links',
|
||||
'@storybook/addon-essentials',
|
||||
'@storybook/addon-interactions',
|
||||
'@storybook/addon-postcss',
|
||||
'@storybook/addon-viewport',
|
||||
'storybook-tailwind-dark-mode',
|
||||
],
|
||||
framework: '@storybook/react',
|
||||
core: {
|
||||
builder: '@storybook/builder-vite',
|
||||
},
|
||||
viteFinal(config) {
|
||||
return mergeConfig(config, {
|
||||
plugins: [
|
||||
/**
|
||||
* @see https://github.com/vbenjs/vite-plugin-svg-icons
|
||||
*/
|
||||
createSvgIconsPlugin({
|
||||
iconDirs: [join(__dirname, '../assets/icons')],
|
||||
symbolId: 'icon-[name]',
|
||||
}),
|
||||
],
|
||||
})
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue