Questions tagged [gruntjs]

Grunt is a task-based command line build tool and task runner for JavaScript projects.

Grunt is a task-based command-line build tool and task runner for projects, that runs on Node.js and is installed via npm.

It runs on plugins that allow it to manipulate files, other languages, and systems, such as , , , , , and .

Some Useful Links

  1. Grunt GitHub Repo
  2. Grunt API
  3. Grunt Documentation
  4. Grunt Plugins

Related Tags for specific Grunt tools and plugins

9083 questions
45
votes
4 answers

How do I manage relative path aliasing in multiple grunt-browserify bundles?

This is tad long but I'll need the code example to illustrate my confusion. After which I am interested to the answer for the following: How do I use require('module') instead of require('../../src/module') or require('./module')? How do I reuse…
Sukima
  • 9,965
  • 3
  • 46
  • 60
44
votes
2 answers

What does ** mean in a path?

ive been setting up Grunt for my web app to auto build it and im seeing paths like /path/to/file/**/*.js i understand what one wildcard means, but what does 2 in a row mean?
Kev
  • 705
  • 1
  • 5
  • 10
44
votes
7 answers

How do you watch multiple files, but only run task on changed file, in Grunt.js?

In learning how to use grunt, I am trying to make a simple coffee-script watcher/compiler. The problem is, if I tell the watch task to watch several files, and one changes, it is going to pass all of the files to the coffee command. This means when…
Lance
  • 75,200
  • 93
  • 289
  • 503
43
votes
3 answers

How to compile .less files on save in Visual Studio 2015 (preview)

Ok, so I've created a new ASP.Net 5/MVC 6 project in Visual Studio 2015 Preview. In keeping with our current method of doing things, for styling I want to use .less files. Creating the files is straightforward, but Web Essentials no longer compiles…
Maverick
  • 4,449
  • 4
  • 36
  • 46
43
votes
3 answers

grunt - getting "Local Npm module "xxx" not found. Is it installed?" What's causing this?

I just received a copy of a grunt package to work on, but I'm new to grunt and am having trouble finding answers to a few things. The biggest issue is not knowing where the errors below are coming from - can someone tell me where this is coming…
u353
  • 990
  • 2
  • 9
  • 16
43
votes
4 answers

Run grunt build command on Travis CI

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…
user2693845
42
votes
5 answers

Grunt wiredep:app no such file or directory bower.json

I'm trying to deploy my Yeoman's Angular app to my production server. When I try to run the grunt build command I get this error: Running "wiredep:app" (wiredep) task Warning: ENOENT, no such file or directory…
doron
  • 1,508
  • 3
  • 18
  • 27
42
votes
4 answers

Grunt: Watch multiple files, Compile only Changed

I'm new to Grunt, and so far I'm enjoying it very much. I want Grunt to compile only the changed files when running grunt watch In my Grunfile.coffee I currently have (relevant parts). Note: assets/javascript/app.coffee and assets/javascript/app.js…
pyronaur
  • 3,515
  • 6
  • 35
  • 52
42
votes
9 answers

Is it possible to compile grunt project from maven?

I'm trying to execute grunt tasks from within maven without needing to install Node.js or anything. This is because I wan't my artifact to be packaged by Jenkins and I can't install Node.js on that machine. I know that it's easy with npm and a few…
Gastón Fournier
  • 956
  • 1
  • 9
  • 25
41
votes
3 answers

Integrating Protractor with Yeoman via Grunt

I want to integrate Protractor with a scaffold produced by Yeoman. I followed a tutorial and therein, the older scenario-runner was used for setting up e2e testing (via grunt). I would like to upgrade my scaffold and use Protractor instead. Any…
user2733090
  • 449
  • 1
  • 5
  • 4
39
votes
2 answers

Why is it recommended to use concat then uglify when the latter can do both?

I keep seeing the recommendation for making JS files ready for production to be concat then uglify. For example here, in on of Yeoman's grunt tasks. By default the flow is: concat -> uglifyjs. Considering UglifyJS can do both concatenation and…
Francisc
  • 77,430
  • 63
  • 180
  • 276
39
votes
4 answers

generator-angular: task "karma" not found when calling `grunt test`

I'm trying to setup a development environment with Yeoman for AngularJS, I installed Yeoman according to the instructions: sudo npm install -g yo bower grunt-cli generator-angular and I'm generating a new app with yo angular. After the app is…
Gal Ben-Haim
  • 17,433
  • 22
  • 78
  • 131
39
votes
3 answers

What is workflow in Yeoman to work with Sass files?

I try to use yeoman but I don't know how to use my own sass files with it. With grunt server Sass files are watched and compiled into .tmp/styles/ But there is no reference to the compiled stylesheet, except
MarekLi
  • 941
  • 1
  • 12
  • 18
39
votes
10 answers

Cannot find module 'findup-sync' when trying to run grunt

I am having trouble running grunt-cli after installing it. I run npm install -g grunt-cli then running grunt errors with node.js:63 throw e; ^ Error: Cannot find module 'findup-sync' at loadModule (node.js:275:15) at require…
Tim Martin
  • 561
  • 1
  • 5
  • 11
39
votes
5 answers

Configure grunt copy task to exclude files/folders

I have installed the grunt task grunt-contrib-copy. I embedd it in my Gruntfile.js and load the task via grunt.loadNpmTasks('grunt-contrib-copy');. Currently I use following configuration to create a folder with a subset of my js…
mybecks
  • 2,443
  • 8
  • 31
  • 43