gruntjs

Grunt task output then calling grunt-notify

浪子不回头ぞ 提交于 2019-12-04 09:44:19
问题 Grunt notify: https://github.com/dylang/grunt-notify is great. However, it seems a bit limited. As far as I can tell all my messages need to be pre-generated. So the first question is how can I generate notifications? Next, It seems that grunt notify triggers based on error or success of some task. I guess based on std in/out/err? The problem where this breaks down is if some task doesn't use these. grunt compass doesn't use stderr if there are compile errors. So how can I run grunt notify

Running grunt-contrib-jshint only on recently modified files

橙三吉。 提交于 2019-12-04 09:08:21
We're going through refactoring the code on a very large site. I would like to enforce linting on any files that get changed, but ignore the rest (as many of them will end up being removed so it's a waste of time to tidy them up). I would like to have a grunt task that checks that a file's modified date is more recent than its created (*fetched from repo) date and lints it if this is the case (would be good also to have grunt update a json list of files to be linted). I haven't used node much apart from grunt and its plugins. I'm going to use http://gruntjs.com/creating-tasks as a starting

“Fatal error: Unable to find local grunt.” on Windows 7

旧街凉风 提交于 2019-12-04 08:51:01
I cannot get grunt to work at all on Windows 7. Following the instructions on the Grunt website ( http://gruntjs.com/getting-started ) I've run: npm uninstall -g grunt-cli npm uninstall grunt npm uninstall -g grunt-init git clone git@github.com:gruntjs/grunt-init-jquery.git c:/Users/me/.grunt-init/jquery npm install -g grunt-cli grunt-init jquery npm install . After that, running "grunt" produces the following output: grunt-cli: The grunt command line interface. (v0.1.9) Fatal error: Unable to find local grunt. If you're seeing this message, either a Gruntfile wasn't found or grunt hasn't been

How to configure sourceMaps for LESS using Grunt?

可紊 提交于 2019-12-04 08:41:26
问题 I'm using grunt 0.4.2 and grunt-contrib-less 0.9.0. I want my LESS to be compiled into CSS with support for source maps. My LESS files are in public/less , and the main one is called main.less . The compiling of public/less/main.less into public/css/main.css works, but source maps don't work. What is wrong with my Grunt config below? { less: { dev: { options: { compress: true, yuicompress: true, optimization: 2, sourceMap: true, sourceMapFilename: "public/css/main.css.source-map.json", /

Updating file references in a json file via a grunt task

淺唱寂寞╮ 提交于 2019-12-04 08:24:21
问题 I'm a JavaScript developer and fairly new to creating a build process from scratch. I chose to use Grunt for my current project and have created a GruntFile that does about 90% of what I need it to do and it works great, except for this one issue. I have several JavaScript files that I reference while I'm developing a chrome extension in the manifest.json file. For my build process I am concatenating all of these files and minifying it into one file to be included in manifest.json . Is there

Avoid Grunt cssmin task to remove duplicate entries

旧巷老猫 提交于 2019-12-04 08:17:44
In my Gruntfile I'm using cssmin (grunt-contrib-cssmin) task. Something like: cssmin: { css : { src: "dist/styles.css", dest: "dist/styles.min.css" } } The problem is: styles.css is generated with a concat task that concatenates lots of .css files. In some of files I have the same css selector (example: .panel a) Only the first one selector is kept bu the cssmin task, all others are removed. I guess it's a default behaviour of the task. Is there a way to keep duplicated selectors? Grunt cssmin has a dependency on node.js module clean-css. I would recommend to use clean-css API within Grunt

Web App (Spring, Angular, Grunt, Maven, Tomcat) running both grunt and tomcat servers

江枫思渺然 提交于 2019-12-04 08:11:35
问题 OK so I've been reading several of the other stack questions and trying to piece this together without much luck. Basically my approach is that I currently have one project with multiple sub-projects. I basically have the following: root |----backend |----|----src |----|----|----main |----|----|----|----java (individual java files not shown) |----|----|----|----resources |----|----|----|----|----META-INF |----|----|----|----|----|----applicationContext.xml |----|----|----|----webapp |----|---

How use require inside a spec - grunt + karma + jasmine in node

∥☆過路亽.° 提交于 2019-12-04 07:56:31
Vague version question: How can I use require inside a spec with grunt? Context: I'm working on an existent node project that has no tests yet, so I read some and realized to use karma and jasmine. I read some tutos (including these): http://kwilson.me.uk/blog/use-karma-and-grunt-to-run-your-jasmine-tests-in-real-time/ http://ahexamples.blogspot.com.br/2014/03/example-of-jasmine-karma-sonar-grunt.html So I'm trying to run my specs with grunt and getting this error: X encountered a declaration exception ReferenceError: Can't find variable: require in file:///(...)-spec.js (line 2) (1) The line

Run grunt build command on Travis CI

你。 提交于 2019-12-04 07:45:06
问题 I am using Travis CI to test and build my project and as part of it I want travis to run grunt build i have tried the following but have had no luck. script: "grunt build" script: "./node_modules/grunt build" script: "./node_modules/grunt/grunt build" script: "./node_modules/grunt/grunt.js build" 回答1: Have you made sure to install grunt-cli globally on your Travis node? My Travis CI config looks like: language: node_js node_js: - "0.8" before_install: npm install -g grunt-cli install: npm

“Fatal error: Unable to find local grunt.” when running “grunt” command

末鹿安然 提交于 2019-12-04 07:39:31
问题 I uninstalled grunt with following command. npm uninstall -g grunt Then I again installed grunt with following command. npm install -g grunt-cli Visit following link: https://npmjs.org/package/grunt-html I want to use the above grunt plugin But when I run the grunt command it gives me following error: D:\nodeJS\node_modules\grunt-html>grunt grunt-cli: The grunt command line interface. (v0.1.6) Fatal error: Unable to find local grunt. If you're seeing this message, either a Gruntfile wasn't