larowlan / vite-plugin-twig-drupal

Provides a vite plugin for rendering Drupal flavoured twig files with Storybook
MIT License
15 stars 4 forks source link

Vite 5 Compatibility #11

Closed alejo-moreno closed 6 months ago

alejo-moreno commented 6 months ago

When trying to install the plugin in a Vite 5 project there's a dependency conflict

$ npm i -D vite-plugin-twig-drupal
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: mag@0.0.0
npm ERR! Found: vite@5.0.12
npm ERR! node_modules/vite
npm ERR!   dev vite@"^5.0.8" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^4.4.11" from vite-plugin-twig-drupal@1.1.0
npm ERR! node_modules/vite-plugin-twig-drupal
npm ERR!   dev vite-plugin-twig-drupal@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

Thanks for the help.

larowlan commented 6 months ago

https://github.com/larowlan/vite-plugin-twig-drupal/pull/12

larowlan commented 6 months ago

https://github.com/larowlan/vite-plugin-twig-drupal/releases/tag/v1.2.0

alejo-moreno commented 6 months ago

That was awesome timing response, thanks @larowlan , i'll be able to propose a new theme to my team using vite+storybook+Drupal. One minor additional thing i had to do after upgrading was converting the config to ESM otherwise it throws an error when storybook starts, here's the doc: https://vitejs.dev/guide/troubleshooting.html#config

larowlan commented 6 months ago

No worries, I default to ESM nowadays so didn't notice that but thanks for pointing out for others.