Uh, but Phoenix doesn’t host out of assets by default, it hosts out of ./priv/static by default, do you have a nav.js in there?
Whatever build system you use at the very least either needs to concat nav into app (the default one that phoenix uses, brunch, does that automatically) or you need to have it copy nav to the output priv/static directory.
This means that everything in the js/navigation directory in assets will be compiled to nav.js, but your listing had no such directory, so that does nothing. Currently app.js is taking in everything under js, so nav is being put into it too.
Should be in something like priv/static/js/app.js or so, and only once you either start the dev server or so.
I doubt it still would, the app.js is grabbing everything under js, including the things in the navigation folder, so when the nav.js entry is hit there is nothing left for it to take. Fixup the app regex to exclude the navigation directory to start.
Wow. I wouldn’t have thought of it as ‘grabbing everything’ in the sense of removing stuff (would have thought it works more cp than mv). I thought it was just spidering the directories. I have a few things I need to do right now but if your solution works I’ll be very impressed!
Yeah. When you’re unemployed and trying to put a showcase site together you tend to go with getting functionality up first. I did read some of the documentation but urg, sometimes it’s difficult to juggle stuff :/. Will have more of a look tomorrow.
I think one of the issues you are battling is that the second pattern covers files that are already included in the first pattern. The easiest way to deal with that is to move everything that is under /js but not in /js/navigation into a separate folder like /js/app. Then rewrite the configuration as:
As you can see, the app.js file is in the same location as the socket.js file, so it’s odd that the import statement seems to be parsed, yet either this is not actually the app.js in the js/app directory, or something is going awry with the routing? Particularly, it’s odd that Phoenix/Brunch is telling me the js/app.js file even exists, since it is now located at /js/app/app.js.
According to the configuration app.js and nav.js have to already exist directly under /js (i.e. move app.js up from /js/app (and change the import paths ) and create a /js/nav.js). /js/nav.jsmay have to import something from /js/navigation in order for brunch to include any of it (though it may be enough for some code referenced by app.js to need it (and not get it because it isn’t in that bundle)).
You can specify multiple subdirectories using arrays for the joinTo pattern match.
Yet I’ve deleted all the requires from the app.js file except import socket from "./socket", so it shouldn’t still be requiring in these additional files, but for some reason it is. Making changes to the brunch file and app.js no-longer seems to affect what I’m seeing in the browser at localhost.
Note that in Atom (run from the $user account via the command line) the static files folder does not even exist, yet in the terminal they do, making it quite difficult to figure out where these files were being compiled and stored to…
Yep. Changes persist. There’s also an Elixir error showing in Atom when I load it via the launcher. This error does not appear when Atom is launched via the command line. Atom also fails to launch via the command line intermittently.