草庐IT

javascript - 咕噜 Jade 错误

每当我运行gruntjade时,我都会得到一个错误:Warning:pattern.indexOfisnotafunctionUse--forcetocontinue.现在这是我的jade任务:jade:{options:{pretty:true},all:{files:{expand:true,cwd:'src/static/jade',ext:"html",src:['src/static/jade/**/*.jade','!src/static/jade/_includes'],dest:'build/'}}}所以基本上我正在尝试获取src/static/jade中的jade文件

javascript - 如何安装咕噜

我用了Homebrew安装Node.js,然后使用npminstall安装Grunt及其依赖,但安装完成后,我无法运行Grunt:zsh:correct'grunt'to'grn'ÆnyaeÅ?nzsh:commandnotfound:grunt安装Grunt的正确方法是什么,这样我就不会收到此错误? 最佳答案 要在命令行上使用Grunt,您必须安装命令行界面:npminstall-ggrunt-cli-g标志用于全局安装模块,这也将为Grunt创建一个PATH变量。 关于javascr

javascript - 咕噜 imagemin 错误 : Cannot read property 'contents' of undefined

当我尝试运行Gruntimagemin时抛出以下错误:Running"imagemin:dynamic"(imagemin)taskFatalerror:Cannotreadproperty'contents'ofundefined这是我的package.json文件:{"name":"project1","version":"0.1.0","devDependencies":{"grunt":"~0.4.1","grunt-contrib-imagemin":"^1.0.0","grunt-contrib-uglify":"^0.11.0","imagemin":"4.0.0"}}这

javascript - 咕噜 requirejs 'define is undefined'

我正在尝试使用GruntJS优化RequireJS,使用grunt-contrib-requirejs插件。问题是我的代码在优化之前工作正常,然后在优化之后,在控制台上显示UncaughtReferenceError:defineisnotdefined。这是Gruntfile.jsmodule.exports=function(grunt){grunt.loadNpmTasks('grunt-contrib-requirejs');grunt.initConfig({requirejs:{compile:{options:{name:'main',baseUrl:".",mainCo

javascript - 咕噜复制单个文件

grunt复制任务指定单个文件复制的格式是什么copy:{dist:{files:[{expand:true,cwd:'',dest:'/scripts/jq.min.js',src:['components/jq/dist/jq.min.js']}]如果我的yeoman.app目录是A并且yeoman.dist是B,这会复制文件到/b/scripts/jq.min.js/components/jq/dist/jq.min.js我想要的是将其复制为/b/scripts/jq.min.js我该怎么做。编辑:我看到一个实现支持的问题。https://github.com/gruntjs/g

javascript - 咕噜任务 : start mongod if not running

如果服务器尚未运行,我想编写一个grunt任务来启动进程mongod。我需要一个正在运行的mongod进程,但还需要grunt-watch以便稍后在任务流中工作。Thisquestion解释了如何使用grunt-shell启动mongod...接受的答案是阻塞的,异步版本将生成一个新服务器,即使存在一个。有没有办法(例如shell脚本)仅在mongod未运行时启动它,而不会阻塞其余的grunt任务流?谢谢 最佳答案 这是一个更简洁的版本将其存储为startMongoIfNotRunning.sh与Gruntfile位于同一位置:#t

php - 咕噜服务 + PHP?

我正在开始我的第一个项目,使用yo+grunt+angular.js。我有一项服务需要从我的服务器读取一些数据;我使用Angular$http服务构建它。我还构建了一个RESTfulWeb服务(用PHP实现,但它可以是Java、C、Perl等,没关系),它公开了一个API来获取数据。grunt为我的ng-app提供服务的服务器当前(并且可能永远)与运行PHPWeb服务的服务器(通过apache)相同。我想知道这是否是一个可以接受的架构......我最终在同一台服务器上有两个不同的服务器(grunt和apache)......而且,我总是必须添加一个“Access-Control-All

javascript - 如何咕噜监视子文件夹中的文件?

我的代码文件夹和文件是这样的,你永远不知道里面有多少个子文件夹:js/sub1/a.jsjs/sub2/b.jsjs/sub3/sub31/c.jsjs/sub4/sub41/sub411/d.js这是Gruntfile.js的一部分:grunt.initConfig({watch:{src:{files:['js/*.js'],tasks:[]}}});Grunt无法使用'js/*.js'查看我所有JavaScript文件的更改。那么如何写出正确的文件路径表达式呢? 最佳答案 根据officialdocumentationonfi

javascript - 咕噜 watch 不工作

我尝试在node.js中通过grunt运行监视任务,但它对我不起作用(这是我得到的):$gruntwatchwarning:MaximumcallstacksizeexceededUse--forcetocontinue.这是Gruntfile.js中watch任务的一部分:watch:{less:{files:'src/less/*.less',tasks:['clean','recess','copy']},js:{files:'src/js/*.js',tasks:['clean','jshint','concat','uglify','copy']},theme:{files:

node.js - 咕噜-鲍尔-安装 : exclude certain components

我刚刚使用angular-fullstackyeoman生成器创建了一个新的web应用程序。我注意到grunt-bower-install正在我的index.html文件中的之间生成JSbower组件。标签。如何排除某些引导组件? 最佳答案 插件grunt-bower-install(又名grunt-wiredep)支持“排除”参数来列出您现在想要自动注入(inject)的组件。例如,如果您不想包含下拉列表,只需列出具有完整路径名的组件:'bower-install':{app:{html:'/views/index.html',i
12