In latest Sage 10 the sage entrypoint script is not executing.
The script entrypoint file is enqueued and downloaded by browser:
This is the test script:
console.log('app init');
import domReady from '@roots/sage/client/dom-ready';
/**
* Application entrypoint
*/
domReady(async () => {
console.log('app');
});
/**
* @see {@link https://webpack.js.org/api/hot-module-replacement/}
*/
if (import.meta.webpackHot) import.meta.webpackHot.accept(console.error);
No console output from the script (console outputs are generally working from other scripts).
This is generated:
"use strict";(self.webpackChunk_roots_bud_sage=self.webpackChunk_roots_bud_sage||[]).push([[143],{"./styles/app.scss":function(){},"./scripts/app.js":function(){console.log("Test")}},function(s){var t=function(t){return s(s.s=t)};s.O(0,[421],(function(){return t("./scripts/app.js"),t("./styles/app.scss")}));s.O()}]);
This is how the script entrypoint is enqueued:
add_action('wp_enqueue_scripts', function () {
bundle('app')->enqueue();
}, 100);
bud
uses the default configuration (composer create-project roots/sage ...
).