Sails.js v0.10 创建新项目 --linker 不工作 Gruntfile.js 未使用 [英] sails.js v0.10 create new project --linker not working Gruntfile.js not used
问题描述
使用 npm 上的默认帆 (v.9?) --linker 工作正常,即创建/linker 文件夹.我可以将 js、css 文件复制到 assets/linker/
并且它们会自动出现在 layout.ejs
中.
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.
我现在在本地和全球都安装了sails v0.10.使用节点 V0.10.25.我使用以下方法创建了一个新的风帆项目:
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
sails new project_name --linker
但没有创建/linker 文件夹.我必须创建 /.tmp
因为它不存在我必须创建 /.tmp/public/linker/
来放置 /js
&/styles
并将它们手动添加到 layout.ejs
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
我重命名了 Gruntfile.js
并且我的程序仍然有效,因此 Gruntfile 在程序中什么也不做.
I renamed Gruntfile.js
and my program still works thus Gruntfile does nothing in the program.
推荐答案
Sails v0.10 不再使用链接器文件夹——它只是引起了混乱.如果您启用了链接器选项,那么当 Sails 被解除时,您的 assets
文件夹下的任何资产都将被 Grunt 复制到您的 .tmp/public
文件夹中.公用文件夹将由 Grunt 根据需要创建.只要程序在运行,grunt-sync
任务就会保持文件夹同步.
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 项目不依赖于 Grunt,因此重命名 Gruntfile(或完全删除它)不会阻止程序运行,但这并不意味着它在那里时什么都不做!要查看 Grunt 正在做什么,您可以使用 sails lift --verbose
来提升 Sails.
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
.
这篇关于Sails.js v0.10 创建新项目 --linker 不工作 Gruntfile.js 未使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!