Question

With the default version of sails on npm (v.9?) --linker works ok i.e. creates /linker folder. I can copy js, css files to assets/linker/ and they appear in layout.ejs automatically.

I now have sails v0.10 installed both locally and globally. Using Node V0.10.25. I created a new sails project using:

sails new project_name --linker

but no /linker folder is created. I had to create /.tmp as it did not exist I had to create /.tmp/public/linker/ to put /js & /styles and add them manually into layout.ejs

I renamed Gruntfile.js and my program still works thus Gruntfile does nothing in the program.

Was it helpful?

Solution

Sails v0.10 no longer uses the linker folder--it was just causing confusion. If you have the linker option enabled, then any assets under your assets folder will be copied over to your .tmp/public folder by Grunt when Sails is lifted. The public folder will be created by Grunt as necessary. The grunt-sync task will then keep the folders synced as long as the program is running.

Sails projects are not dependent on Grunt, so renaming the Gruntfile (or removing it completely) won't stop the program from working, but that doesn't mean it's not doing anything when it's there! To see what Grunt is up to, you can lift Sails with sails lift --verbose.

OTHER TIPS

As an add-on to sgress454's answer, the reason a .tmp folder is created is so that files like the ejs and less files can be compiled into formats that your browser will understand. It's similar to the way that when you compile Java, it converts to Java bytecode (just an analogy, definitely not the same process).There doesn't necessarily have to be any .tmp folder when you're not running the server though; this is something Grunt creates and is what the browser reads from. Hope this clarifies things a bit more.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top