Closed dhmax88 closed 2 months ago
These are called namespaces in twig, see the docs in the README - https://github.com/larowlan/vite-plugin-twig-drupal?tab=readme-ov-file#installation
Thanks for the speedy reply @larowlan
When using namespaces I run into the same issue and get this error:
import '/var/www/html/src/templates/typography/@templates/button/button';
which would suggest the namespace isn't functioning as expected
Can you share your config? Thanks
I realise the issue, and it's most likely due to my own ignorance!
twig({
namespaces: {
templates: join(__dirname, '/src/templates'),
},
}),
the above adds the '@' in the plugin, so this is then used as @templates/
in the storybook files. I was setting the @ in the namespace itself.
Sweet! If I can update the readme at all to make it clearer, please let me know 👍
I'm trying to use includes with an alias from vite, i.e.
so I can then do:
{% include '@templates/button/button' %}
within storybook files.But the alias is not being picked up within Storybook. Does anyone have this working?