How do I actually use the frontend files that Composer installs? Specifically JavaScript. I've been able to use a PHP file previously, but JavaScript files are breaking my brain...
I've installed Composer and used it to install a package (Handlebars, specifically). Everything looks like it should. I've got a handlebars folder in my vendor folder and it created a "components" folder with some JavaScript files in it, so I know things are there. I've tried just doing this:
<script type="text/text/javascript"
src="/components/handlebars/handlebars.js"></script>`
But that doesn't seem like what I should be doing and doesn't seem to work anyway. I see there's some require files in there as well, but I've tried referencing them with no luck.
I would hope that just including require __DIR__ . '/vendor/autoload.php';
would do it, but that seems to just bring in the backend stuff.
It seems that Bower may be better suited for frontend stuff like this, but I'm already using Composer for another part of the project, so it would be nice to not have to use two different package managers in one project.
question from:
https://stackoverflow.com/questions/65950354/how-to-use-javascript-or-css-files-installed-by-composer 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…