Hello,
I think it must be something simple, but while migrating a Sage9 based theme to build with Bud, I’m running into an issue where the JavaScript does not execute. I’ve simplified things completely with only an alert, but it still does not execute.
function sayHello() {
alert("this is my code here");
}
sayHello();
app.js (compiled)
(self.webpackChunk_roots_bud=self.webpackChunk_roots_bud||[]).push([[524],{"./scripts/main.js":()=>{alert("this is my code here")},"./styles/main.scss":()=>{}},s=>{var e=e=>s(s.s=e);e("./scripts/main.js"),e("./styles/main.scss")}]);
app.js is loaded by the page but the alert does not execute. I can see that Bud is wrapping things but am not certain how to trigger the code that it wraps.
Thanks!
I was not using acorn as I did not want to upgrade to PHP 8 yet given some legacy code. However, in the end I think the safer and more long term approach will be to just upgrade to Sage 10. I also tried using the “bundle” method, but then needed to include parts of Sage library for that as well. In the end I think it’s better not to hack things in and simply take the time to port the existing theme.