vite-plugin-yaml
vite-plugin-yaml copied to clipboard
Unable to make it work with Storybook
When running with npm run build-storybook
I get
vite v4.1.4 building for production... ✓ 421 modules transformed. [vite:build-import-analysis] Parse error @:1:43
But npm run build
works correctly. Not really sure which part is causing the issue though.
I'm having a similar issue with vite 5, Storybook 7, and the latest version of this library (1.1.0). Building Storybook and running Storybook work fine, but when I go to look at my component that uses info from a .yml
file, I get Error: Cannot read properties of undefined (reading 'titleTooltip')
, where titleTooltip
is being accessed as content.instanceDetailsInsights.titleTooltip
, and content
is a content.yml
file that we are importing into the project that has our copy in it.
Here is where we're configuring the plugin in Storybook:
viteFinal: async config => {
return mergeConfig(config, {
resolve: {
alias: {
"@": path.resolve(path.dirname(__dirname), "src")
}
},
plugins: [ViteSvgr({ include: '**/*.svg' }), ViteYaml()]
});
},