Comments (1)
Currently, as a countermeasure, I am using a plugin called force-reload-on-specific-files
to reload.
import type { StorybookConfig } from "@storybook/react-vite"
import { InlineConfig, UserConfig, mergeConfig } from "vite"
import path, { dirname, join } from "path"
const config: StorybookConfig = {
framework: getAbsolutePath("@storybook/react-vite"),
core: {
disableTelemetry: true,
},
stories: ["../stories/**/*.@(mdx|stories.@(tsx))"],
addons: [
getAbsolutePath("@storybook/addon-viewport"),
getAbsolutePath("@storybook/addon-docs"),
getAbsolutePath("@storybook/addon-a11y"),
getAbsolutePath("@storybook/addon-backgrounds"),
getAbsolutePath("@storybook/addon-measure"),
getAbsolutePath("@storybook/addon-storysource"),
getAbsolutePath("storybook-dark-mode"),
],
viteFinal: async (config) => {
config = mergeConfig<InlineConfig, UserConfig>(config, {
+ plugins: [
+ {
+ name: "force-reload-on-specific-files",
+ handleHotUpdate: ({ file, server }) => {
+ const isTheme = file.startsWith(
+ path.resolve(__dirname, "../packages/theme/src"),
+ )
+ const isProviders = file.startsWith(
+ path.resolve(__dirname, "../packages/providers/src"),
+ )
+
+ if (isTheme || isProviders) {
+ server.hot.send({ type: "full-reload" })
+ }
+ },
+ },
+ ],
resolve: {
alias: [
{
find: /\@yamada-ui\/react$/,
replacement: path.resolve(__dirname, "../packages/react/src"),
},
{
find: /\@yamada-ui\/theme$/,
replacement: path.resolve(__dirname, "../packages/theme/src"),
},
],
},
})
config.esbuild = undefined
return config
},
typescript: {
reactDocgen: false,
},
}
export default config
function getAbsolutePath(value: string): any {
return dirname(require.resolve(join(value, "package.json")))
}
from storybook.
Related Issues (20)
- [Bug]: defaultProps Warnings HOT 1
- [Bug]: Failed to execute 'insertRule' on 'CSSStyleSheet' : Storybook 8.0.6
- Check command seems to be inconsistent HOT 1
- [Bug]: Docs stories filtered with `'!autodocs'` behaves weird in `Primary`, `Stories`, `Controls`, etc. components HOT 5
- Bench script flakiness
- [Bug]: Can't install latest version with the Next.js option HOT 1
- [Bug]: Typescript JSX types for Vue3 (Vite project) . The type of the tsc command is incorrect
- [Bug]: Not possible to map complex types to different types with typescript and react
- [Bug]: Load component fail after publish HOT 1
- [Bug]: @storybook/addon-controls break some stories HOT 4
- [Bug]: Viewports arenβt reset when navigating away from a story with a default viewport HOT 1
- [Bug]: Footer of save-from-controls position is not attached to bottom of the panel
- [Bug]: Error: 'MissingStoryAfterHmrError' is not exported by node_modules/@storybook/core-events/preview-errors.js, imported by node_modules/@storybook/preview-api/dist/index.mjs
- [Bug]: "The `docs.autodocs` setting in '.storybook/main.js' is deprecated." Appears even after migrating
- [Bug]: Storybook can't render "SVGSVGElement"
- [Bug]: Mobile emulator has wrong width on initial render after page reload
- [Bug]: Stories are not overwriting {control: false} from meta (argTypes)
- [Bug]: Yarn 4 PnP with Storybook 8 => @storybook/addon-essentials not work HOT 1
- [Bug]: `parameters.options` are not respected when navigating to a story for the first time
- [Bug]: `storybook init` fails to setup dependencies correctly when `--skip-install` install is set in ci/cd pipeline
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook.