You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I want to use Vite, a modern asset bundler, when developing a custom OJS theme. However, it is not possible to load the JavaScript assets using the TemplateManager::addJavaScript() function, because it does not support module script tags.
<script type="module" src="..."></script>
I can work around this in my own theme. However, I am preparing a Composer package to make the setup easier for the community. It would be best for this use case if I could integrate directly with the {load_scripts} template tag.
To Reproduce
I am aware that this is not a bug and I of all people campaigned to keep requests out of the issues. 😆 But I have a PR incoming.
What application are you using?
I'd like this to go back to OJS 3.3 if possible, for a client.
The text was updated successfully, but these errors were encountered:
NateWr
added a commit
to NateWr/pkp-lib
that referenced
this issue
Oct 2, 2024
The following PRs add this feature by extending the $args param of TemplateManager::addJavaScript(). To load a module script, you can use the following code:
@NateWr Hi Nate, I don't see reason not to include this PR.
Just to learn more, for ui-library we end up building 'iife' format, because with script type=module its not easy to enforce order with respect to other JS dependencies we load.
So just curious whether that possibly work for you in your scenario?
Describe the bug
I want to use Vite, a modern asset bundler, when developing a custom OJS theme. However, it is not possible to load the JavaScript assets using the
TemplateManager::addJavaScript()
function, because it does not support module script tags.I can work around this in my own theme. However, I am preparing a Composer package to make the setup easier for the community. It would be best for this use case if I could integrate directly with the
{load_scripts}
template tag.To Reproduce
I am aware that this is not a bug and I of all people campaigned to keep requests out of the issues. 😆 But I have a PR incoming.
What application are you using?
I'd like this to go back to OJS 3.3 if possible, for a client.
The text was updated successfully, but these errors were encountered: