FAQ Database Discussion Community


Grunt grunt-contrib-cssmin runs unending doesn't combine files

node.js,gruntjs,grunt-contrib-cssmin
I am having a strange issue with grunt-contrib-cssmin. It never stops or gives errors. I am using C:\projects\doeclf>grunt --version && node --version && npm --version grunt-cli v0.1.13 grunt v0.4.5 v0.12.4 2.10.1 My grunt.js has following in it cssmin: { target: { files: [{ expand: true, cwd: 'css/', src: ['index.css', '!*.min.css'],...

Error 'uiGrid' must have exactly one root element. ui-grid/ui-grid when UI-Grid is initiated

angularjs,gruntjs,ng-grid,angular-ui-grid
While trying to add ui-grid to an angular project, I came across this issue. I’ve bootstrapped the angel;ar application with ui-grid dependency injected. var app = angular.module(‘myApp’,
 ['ui.bootstrap',
 'services',
 'filters',
 'directives',
 'controllers',
 'ui.grid'
 ]); The controller looks like this. angular.module('controllers').controller('UIGridCtrl',function UIGridCtrl($scope) {
 $scope.init = function(){
 $scope.myData = [
 {"firstName": "Cox",...

How do I access a user input from grunt-prompt in other tasks

javascript,gruntjs,grunt-prompt
I need to write a grunt job for reading a user input using grunt-prompt and then create a directory with that name. I am trying to use the config to access variable in another grunt task which will be executed after the grunt-prompt. But all following methods gives an undefined....

Add locale moment to an AngularJS app

angularjs,gruntjs,momentjs
I'm trying to configure the locale language for an AngularJS app based on Yeoman. When I serve the dist package after building my app (grunt build), the script reference dissapears. Here's a list of my dependencies on the index.html file. <!-- build:js(.) scripts/vendor.js --> <!-- bower:js --> <script src="bower_components/jquery/dist/jquery.js"></script> <script...

Why doesn't postinstall run everytime?

jenkins,gruntjs,npm
I have a package.json file that has the following JSON at the bottom. "scripts": { "postinstall": [ "./node_modules/bower/bin/bower install && ./node_modules/protractor/bin/webdriver-manager update" ] } My reason for having this is so bower dependencies and my protractor tests will run after an "npm install". However, it seems that "postinstall" doesn't always...

Is grunt.file.write(…) synchronous or asynchronous?

javascript,node.js,asynchronous,gruntjs
I have a code in which i am running a grunt task asynchronously using var done = this.async(); Somewhere in the code I am writing to a file and then calling a callback as follows: grunt.fie.write(<necessary arguments>); callback(null); My question is, will there be a case in which the callback...

grunt-contrib-jade compiling to single JS with cwd

gruntjs,jade
I am trying to compile multiple jade templates into single JS file using grunt-contrib-jade. Problem I'm facing is that with full path to templates, I get function names with full path. I want to avoid that, so I tried using cwd (without expand). This ended up with the following: >>...

How to setup grunt-babel to transpile an entire directory

gruntjs,babel,transpiler
So I have this in my gruntfile: gruntConfig.babel = { options: { sourceMap: true }, dist: { files: { "dist/server.js": "src/*.js" } } }; This correctly transpiles all the js files in src, but it overwrites dist/server.js every time. This must be really simple, but I can't seem to figure...

How to make grunt run some tasks at a special point in time?

javascript,node.js,testing,gruntjs,automated-tests
I am using Grunt to run Jasmine tests and Nightwatch.js tests. Is it possible to make Grunt run the tests at a special point in time? For example Grunt could run the tests always when saving changed code. Or Grunt could run the tests always at 1 am in the...

Grunt Build Aborted Due to Warnings

angularjs,gruntjs,yeoman,karma-jasmine,yeoman-generator-angular
I'm new to angular and I'm working with Yeoman scaffolded apps and Grunt. I successfully created a few Grunt builds earlier on in the project but now when I do: Grunt build I get the following message: I'm not sure how to interpret the command line output which is below....

Does an existing gruntfile need to be edited? What is the common workflow?

angularjs,gruntjs,yeoman,bower
For an existing app, is there a proper protocol for specifying bower packages such that they're handled correctly when running "grunt build"? Does an existing gruntfile need to be edited? What is the common workflow?

grunt-contrib-cssmin : Relative path of images is not replaced in target minified file

css,gruntjs,relative-path,grunt-contrib-cssmin
I am using grunt-contrib-cssmin, for the minification of my css files. I want the relative urls in the css files to be replaced automatically in my target minified file. I have looked for this problem and found the two options that I can use to replace the url, target, root...

Grunt inject CSS file into