After installing brunch on my Windows machine using npm (npm install brunch
), I proceeded to create and build a new project in my www root directory (specifically, the Apache www root).
cd .../www
brunch new someproject
cd someproject
brunch build
Upon entering localhost/someproject/public
in my browser, I encountered the following errors in the console log (using Chrome):
GET http://localhost/stylesheets/app.css 404 (Not Found) localhost:9
GET http://localhost/javascripts/vendor.js 404 (Not Found) localhost:10
GET http://localhost/javascripts/app.js 404 (Not Found) localhost:10
Uncaught ReferenceError: require is not defined
It appears that the paths for these files are hardcoded from the root path. How can I resolve this issue? Do I need to make changes in the brunch config file?
I am aware that I have the option to use brunch watch --server
and access it through localhost:3333
, but I prefer using Apache instead. Essentially, I am facing difficulties deploying the app into production within the public folder.