Custom Component script.js not compiling #591
-
I'm creating a new component (for banner messages) in 'Components/SiteBanners' - the Do I need to do anything different because the component adds fields to a Global Options sub-page? That's the only thing I can think of which is different to other components. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@Iain-g can you share the component's code? this would be a sample
|
Beta Was this translation helpful? Give feedback.
Hey @Iain-g it seems to work for me. I've added it as a minimal / empty component like this:
https://github.com/aaronmeder/various-code/tree/main/Flynt-Components/SiteBanner
To test I've added it this the templates/_document.twig file directly inside the
<body>
:{{ renderComponent('SiteBanner') }}
When I open the site it will show the "init SiteBanner 👋🏻" output in the browser console as expected.
You should also be doing that if you haven't:
VITE_DEV_SERVER_HOST=http://yourlocalwpsite.test
(adjust the domain to point to your local Wordpress site)npm run start
(and keep running) ornpm run build:production
in the theme dir…