Search code examples
gitgruntjsmean-stackmeanjs

How to make changes once MEANJS app is deployed?


So this may be a basic question, but I am unable to figure this one out. Also this is my first MEAN app, so excuse the ignorance. I have successfully deployed my MEANJS app onto the remote server in a test folder. Everything is working fine. I then cloned the repository on my remote server onto my computer in order to make changes to the code. I then push these changes into the master. Now the problem I am facing is:

  1. I deployed the meanjs app with grunt build. This created a dist folder containing application.js, application.min.js and application.min.css
  2. I am making changes to the actual files within my original public/modules/ folders, as well as to the app/controllers/ folder. (on my local machine)
  3. The changes I make to the public folders are all reflecting once I push the files up, but the changes to app/ folders are not reflecting, even on my local machine. I think I am missing a basic point here, coz before the grunt build I could easily manipulate the app/ files. I cannot even see any console.log statements I am entering anymore.

So the question is, do I need to change something in the application.js file in my dist/ folder? How can I keep making changes even after grunt build? Are the app/ folder files no longer being read from there, but from another location? I would really appreciate an explanation.


Solution

  • So the answer is to run

    grunt build
    

    once again, after you make all the changes to your controllers. This will rebuild your application.js, application.min.js and application.min.css, which can be safely uploaded to your final production MeanJS app. Note that you do not need to re-build after making changes to view files, as these can be uploaded as is and are read directly by your application.min.js.