Import images using by default webpack configuration #14921
Unanswered
NatalyIvanova
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I run Angular 11.2.7 project + Storybook 6.2.9 configuration out of the box.
According to documentation, by default webpack configuration allows to import static image file into component.ts and stories.ts:
When the line is added to Button.stories.ts, it causes a compilation error: "TS2307: Cannot find module './assets/image.png' or its corresponding type declarations."
The project structure:
-.storybook
-src
--stories
---assets
----image.png
---Button.stories.ts (the one that imports)
Do I need additional configuration?
Beta Was this translation helpful? Give feedback.
All reactions