I just started a new brunch.io project using a brunch-brunch skeleton (I just want the local server to be able to display its own HTML / CSS / JS).
I created two files myself: index.html, located in the public / containing the standard doctype, head and body tags plus a script tag referencing the brunch-generated app.js located in public / javascripts / app. js as below:
<script type="text/javascript" src="javascripts/app.js"></script>
As indicated in the README.md file located in the app / directory, I write my application-specific files in the app / directory. Therefore, I have a file called app.js located in application / and containing:
console.log("OK");
I start the server using the command:
brunch watch --server
The problem is that I do not see anything in the js console (the server runs on localhost: 3333), despite the fact that html is rendered, and public / javascripts / app.js (generated by brunch) contains these lines (among others) :
require.register("app", function(exports, require, module) { console.log("ok"); });
What's happening?
EDIT: javascript directly written in the html script tag works fine.
source share