grunt:可能重新定位“node_modules”插件? [英] grunt: possible to relocate "node_modules" for plugins?
问题描述
如果我安装了任何grunt插件,它将默认添加到我的项目目录的根目录中名为node_modules的文件夹中。
我的问题:是否可以将整个文件夹(因此所有插件)移动到另一个位置(但仍在我的项目文件夹中),让我们说构建/ node_modules?
当然,我仍然希望能够在项目层次结构中的任何位置运行grunt。
./
开头的c>调用将尝试在 node_modules
文件夹。 If I install any grunt plugin, it is added to a folder named "node_modules" in the root of my project dir per default.
My question: is it possible to move this whole folder (and therefore all plugins) to another location (but still within my project folder), let's say to "build/node_modules" ?
Of course, I still want to be able to run grunt from anywhere in my project hierarchy after this change.
Nope, that's a feature of the Node.JS core files. In the case you don't know, Node.JS is the platform which Grunt was built.
All require()
calls which don't point to an absolute file or start with ./
will try to find modules inside node_modules
folders.
这篇关于grunt:可能重新定位“node_modules”插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!