Tag: gruntjs

Grunt Combine Media Queries – 不能调用未定义的方法“join”

我今天早上发现了Grunt Combine Media Queries插件,并且一直在考虑让它在我的版本上运行,因为我们在CSS中使用了大量的媒体查询声明(我们正在使用SASS)减less。 cmq: { options: { log: true } , your_target: { files: { '<%= meta.cssPath %>temp': ['<%= meta.cssPath %>hayes.css'] } } } cssPath只是CSS所在的目录。 当我运行grunt cmq时,出现以下错误: Processed media queries: @media screen and (-webkit-min-device-pixel-ratio: 0) @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) @media only screen and (min-device-pixel-ratio: 2) @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen […]

Grunt安装错误/ s:“应该用-g安装”

我试图在我的机器上安装Grunt。 我已经阅读了一些教程,并按照安装文档 ,但我不能得到它的工作。 CLI使用以下命令安装好: sudo npm install -g grunt-cli 当我select一个本地目录(包含package.json和Gruntfile)和npm install ,我看到以下消息: npm WARN prefer global grunt-cli@0.1.9 should be installed with -g 为什么发生这种情况? 我确实用-g安装 – 意思是“全局的”,我明白了。 在此之后,似乎我不能跑咕噜,例如: $ grunt -bash: grunt: command not found $ grunt –version -bash: grunt: command not found 我怎样才能解决这个问题? 我错过了什么? 这是我的完整日志: $ sudo npm install -g grunt-cli Password: npm http GET […]

Grunt Uglify通配符和版本控制

我一直在尝试一段时间,以特定的方式结合两个Grunt JS插件。 基本上,我想使用UglifyJS来缩小目录中的所有JS文件。 在此之后,我想使用版本控制插件(在这种情况下grunt-static-versioning)来实现caching清除。 我的gruntfile如下: module.exports = function(grunt) { grunt.initConfig({ clean: ['dest/js'], uglify: { options: { report: 'min', mangle: true }, my_target: { files: [{ expand: true, cwd: 'src/js', src: '**/*.js', dest: 'dest/js' }] } }, cssmin: { options: { report:'min' }, minify: { expand:true, cwd: 'src/css', src: '**/*.css', dest: 'dest/css', } }, imagemin: { […]

Yeoman返回'env:node \ r:没有这样的文件或目录'

我按照这些说明来安装Yeoman 。 一切都很好,直到我进入目录,并执行yo webapp从terminal(也尝试sudo yo webapp )。 它返回env: node\r: No such file or directory ,我从来没有达到select这种types的networking应用程序的步骤。 有任何想法吗? 在Mac OS 10.9上。 更新了Ruby,Node.js,Git。 而且从我读过的Yeoman安装Grunt和Bower。

grunt init:节点不工作

我正在尝试做一个介绍咕噜教程。 我已经在全局安装了git,node.js和grunt(或者至less我以为我用过:npm install -g grunt(安装)),然后创build了一个快速目录并input它(mkdir demo,cd demo),但是当我input: > grunt init:node 在提示符下,我得到以下内容: grunt-cli: The grunt command line interface (v0.1.11) Fatal error: unable to find local grunt If you're seeing this message, either a Gruntfile wasn't found or hasn't been installed locally to your project. For more information about installing and configuring grunt, please see the Getting […]

当通过grunt-contrib-watch观看direcory时,如何检索已更改文件的名称?

说我有一个CSS文件的目录,我的Grunt监视任务是这样configuration的: watch: { css: { files: ['css/*.css'], tasks: ['foo'] } } foo是我自己的自定义任务: grunt.registerTask('foo', function () { // but which file changed? }); 因此,只要该目录中的任何CSS文件发生更改,Grunt就会调用我的foo任务。 我想从我的任务中检索受影响的CSS文件(更改的文件)的文件名。 我希望这是可能的。

EJS在gruntfile中转义

我在gruntfile中有下面的代码: 'string-replace': { inline: { files: { 'entity/templates/': 'entity/templates/*', }, options: { replacements: [{ pattern: /Article/g, replacement: '<%= entityName %>' }, { pattern: /article/g, replacement: '<%= _.slugify(entityName) %>' }] } } } 我试图用一个expression式replace几个文件中的“文章”一词。 我希望这个expression式能够在被replace的文件中被打印出来,但是现在它被评估了。 我如何逃避代码? 我使用https://github.com/erickrdch/grunt-string-replace,但我认为问题在于如何评估expression式,对不对? 错误消息如下所示: 警告:处理模板时发生错误(entityName未定义)。 使用–force继续。

尝试安装npm软件包,并获得EN0ENT错误的一切

这是运行npm install grunt-cli的示例输出 注意重复的node_modulespath? 这是一个环境path问题吗? 当我在OSX上的其他用户上尝试相同的命令时,它可以正常工作。 运行最新的OSX 10.9.1 npm http 304 https://registry.npmjs.org/weak npm http 304 https://registry.npmjs.org/bunker npm http 304 https://registry.npmjs.org/argparse npm http 200 https://registry.npmjs.org/mocha/-/mocha-0.3.3.tgz npm http 200 https://registry.npmjs.org/should/-/should-0.3.2.tgz npm http GET https://registry.npmjs.org/tiny-lr/0.0.4 npm http GET https://registry.npmjs.org/cli/0.4.3 npm http GET https://registry.npmjs.org/jasmine-node npm ERR! Error: ENOENT, lstat '/Users/shanejordan/Documents/Projects/KiddoMath/code/node_modules/grunt-cli/node_modules/resolve/node_modules/tap/node_modules/difflet/node_modules/traverse/index.js' npm ERR! If you need help, you may report […]

无法使用Grunt编译Bootstrap 3 LESS主文件(bootstrap.less)?

我无法将“主” bootstrap.less编译为'<%= pkg.name %>.css' 。 我得到这个错误运行grunt less : Running "less:dist" (less) task >> ParseError: Syntax Error on line 643 in bower_components\bootstrap\less\mixins.less:643:25 >> padding-right: (@grid-gutter-width / 2); >> &:extend(.clearfix all); >> } Warning: Error compiling LESS. Use –force to continue. Aborted due to warnings. 我的configurationless任务是相当简单的: less: { options: { strictMath: true }, dist: { files: { […]

在“入口”上的Grunt-webpack通配符

我正在使用Grunt编译页面级JS资产。 webpack: { build: { entry: { // Add your page JS here! home: "./assets/scripts/tmp/Pages/home.js", events: "./assets/scripts/tmp/Pages/events.js" }, output: { path: "./public/scripts" } } } 这是我目前正在做的,但我想要做的事情是这样的: webpack: { build: { entry: "./assets/scripts/tmp/Pages/*", output: { path: "./public/scripts" } } } 然而,这个失败与“错误在Entry模块找不到:”错误。 我已经试过SRC和DEST选项,但他们似乎甚至没有编译文件:S 提前致谢