3

I am working in a project with sail.js everything is ok but each time I modified something I have to restart "sails lift". Is there not an option where with the server online I could work and see all the changes I did?

As info the problem is more with the js and styles, also I use foundation and when I compile with grunt, I always have to restart the server.

I use this option for raise the sails:

 Sails lift --dev --verbose
9
  • Are you saving your Javascript and CSS files under the /assets directory? That's the only folder that gets copied by Grunt.
    – sgress454
    Mar 25, 2014 at 15:17
  • Yes, there and under linker/ Mar 25, 2014 at 15:32
  • When you save a .js or .css file, do you see any output in the console indicating that Grunt processed the file? Or any errors?
    – sgress454
    Mar 25, 2014 at 15:37
  • Could be for that verbose: Rendering view :: home/index (located @ /Users/em/php/swapit/views/home/index) verbose: Grunt :: Fatal error: EMFILE, readdir '/Users/em/php/swapit/assets/linker/js/' verbose: Grunt :: Fatal error: EMFILE, readdir '/Users/em/php/swapit/assets/linker/js/' Fatal error: EMFILE, readdir '/Users/em/php/swapit/assets/linker/js/' Mar 25, 2014 at 15:53
  • 2
    EMFILE means you're hitting the open file limit. See stackoverflow.com/questions/34588/…
    – sgress454
    Mar 25, 2014 at 16:21

2 Answers 2

1

Actually in old versions of sails.js you don't. But starting v0.11.0+ you have an ability to install autoreload hook that will do exactly what you need.

npm install --save-dev sails-hook-autoreload

But there is one note: It wouldn't automatically apply changes into your config files. So if you will change something there, you will have to restart sails manually.

And here is a link to this hook: https://github.com/sgress454/sails-hook-autoreload

0

Why not use nodemon instead ?
look into this : https://nodemon.io/
It does the work for me .
just do a npm install --save nodemon and instead of sails lift you could use nodemon -w *x

*x = (whichever folder you want to watch)

for example nodemon -w api -w config will restart the app automatically if there is a change api or config folder

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.