Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: storybook 에러 디버깅 #110

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .storybook/config/nextImage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as NextImage from 'next/image'

const OriginalNextImage = NextImage.default
Object.defineProperty(NextImage, 'default', {
configurable: true,
value: props => <OriginalNextImage {...props} unoptimized />
})

export default OriginalNextImage
2 changes: 2 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ module.exports = {
extensions: config.resolve.extensions
})
]
config.resolve.alias["next/image"] = require.resolve("./config/nextImage.js");

return config
}
}
8 changes: 2 additions & 6 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { theme } from '@themes'
import { ThemeProvider } from '@emotion/react'
import { GlobalStyle } from '../src/styles'
import * as NextImage from 'next/image'

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
Expand All @@ -22,8 +21,5 @@ export const decorators = [
)
]

const OriginalNextImage = NextImage.default
Object.defineProperty(NextImage, 'default', {
configurable: true,
value: props => <OriginalNextImage {...props} unoptimized />
})


sonsurim marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
},
"cSpell.words": ["stylelint"]
"cSpell.words": [
"stylelint",
"unoptimized"
]
}