gruntjs

Shim from grunt-contrib-requirejs not wrapping library

蹲街弑〆低调 提交于 2019-12-05 10:01:37
I am using requirejs and configuring my product artifacts, thus combining my libraries and setting up module dependencies between them to get the loading sequence appropriate using the grunt task for requirejs. I have no problem using runtime module injection while in my livereload server which has access to non-combined libraries. For the sake of clarity I have disabled all minification/uglification and turned on a js-beautify. requirejs: { dist: { // Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js options: { // `name` and `out` is set by grunt-usemin // name: 'App

How to copy files without the full path with grunt.js?

Deadly 提交于 2019-12-05 09:16:42
问题 I want to copy the content of /pckg to /dist with grunt.js. Here is the structure: |-- folder1 | | | |-- folder2 | | | |-- pckg | | | |--myfolder | | | | | |-- myfiles | | | |--myfiles | | |-- dist | |--myfolder | | | |-- myfiles | |--myfiles Here's my Gruntfile.js module.exports = function (grunt) { // Package configuration grunt.initConfig({ // Metadata pkg: grunt.file.readJSON('package.json'), //Copy files copy: { main: { expand: true, src: 'folder1/folder2/pckg/**', dest: 'dest/' } } });

Gruntfile getting error codes from programs serially

落花浮王杯 提交于 2019-12-05 09:16:09
I want to create a grunt file that runs 3 grunt tasks serially one after another regardless of whether they fail or pass. If one of the grunts task fails, I want to return the last error code. I tried: grunt.task.run('task1', 'task2', 'task3'); with the --force option when running. The problem with this is that when --force is specified it returns errorcode 0 regardless of errors. Thanks Use grunt.util.spawn : http://gruntjs.com/api/grunt.util#grunt.util.spawn grunt.registerTask('serial', function() { var done = this.async(); var tasks = {'task1': 0, 'task2': 0, 'task3': 0}; grunt.util.async

No agent could be found with the following capabilities: grunt

爱⌒轻易说出口 提交于 2019-12-05 09:01:48
When I try to queue a build on my on-premises TFS 2015 Update 1 I get the following error message: No agent could be found with the following capabilities: grunt I've already installed NodeJS and grunt-cli and they're in the path (i.e. they can be executed in cmd from any location). What am I missing? Go to your pool settings page: http://SERV_NAME:8080/tfs/_admin/_AgentPool and select your agent, verify that grunt is added as a system capability with the correct path set. If it's not there, you can manually add it as a user capability Something recalculates the system capabilities but I'm not

grunt-contrib-jshint ignores has no effect

▼魔方 西西 提交于 2019-12-05 08:50:34
问题 I would like to exclude libs directory from being lint'ed. However, ignores in options and planted .jshintignore file in project directory won't make libs to be excluded. jshint: { options: { smarttabs: true, ignores: ['public/js/libs/**/*.js'] }, all: [ 'Gruntfile.js', 'public/js/**/*.js' ] }, grunt version: grunt-cli v0.1.11 grunt v0.4.2 grunt-contrib-jshint@0.7.2 What did I miss out? 回答1: ignores is a jshint option and expects specific files. It's better to use the idiomatic Grunt negate !

how to include ngAnimate dependency in angular with yeoman

怎甘沉沦 提交于 2019-12-05 08:01:34
I am create an angular application using the combination of yeoman, gruntjs and bower. I installed my angular app with yo angular myapp and then added few dependencies with bower and finally I would run grunt server and start working. Only when I try to add the ng-animate dependency, I get into problems. This dependency gets downloaded but its scripting tag does not get added into index.html and the required reference does not get added into the karma.conf.js file. I have tried to add these two references manually: in the index.html <script src="bower_components/angular-animate/angular-animate

Getting grunt error on sails lift

我怕爱的太早我们不能终老 提交于 2019-12-05 07:15:40
I am getting this error on sails lift. Sails version : v0.10.0-rc11 error: Grunt :: module.js:340 throw err; ^ Error: Cannot find module '/home/mandeep/freelance/hellos/node_modules/sails/node_modules/grunt-cli/bin/grunt' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3 info: I have tried uninstalling grunt globally and then re-installing but its not working Looks like something got corrupted in your Sails install. In your project directory do: npm

Using almond with grunt-contrib-requirejs

与世无争的帅哥 提交于 2019-12-05 06:32:59
I'm trying to set up a gruntfile that utilizes requirejs and almond. The docs suggest it should be really easy, and following their lead, I tried: requirejs: { compile: { options: { baseUrl: "tmp", mainConfigFile: "tmp/main.js", name: "../bower_components/almond/almond", out: "tmp/<%= pkg.name %>.js" } } } Unfortunately, this approach compiles almond.js rather than my actual source. Am I getting something wrong? How do I automate almond along with requirejs? The trick is to use include : requirejs: { compile: { options: { baseUrl: "tmp", mainConfigFile: "tmp/main.js", include: "main", name: ".

Grunt Livereload + Grunt Connect Proxy

99封情书 提交于 2019-12-05 06:16:07
问题 I am using Rails for my API, AngularJS on the front and I am having some issues getting livereload / grunt connect proxy to work properly. Here is the snippet from my gruntfile: connect: { options: { port: 9000, // Change this to '0.0.0.0' to access the server from outside. hostname: 'localhost', livereload: 35729 }, proxies: [ { context: '/api', host: 'localhost', port: 3000 } ], livereload: { options: { open: true, base: [ '.tmp', '<%= yeoman.app %>' ], middleware: function (connect,

how to have grunt task render mustache partials to static HTML

十年热恋 提交于 2019-12-05 06:00:16
问题 Background I've been using grunt.js with a hogan.js task to build the static HTML for our internal docs. I'm learning JavaScript as I go, but I've gotten the task to work well enough for layouts and pages, but it would really help our workflow to have the hogan task render mustache partials to HTML, as in the example in this gist: https://gist.github.com/4132781 Current Setup and what I want to accomplish All of our mustache partials are in a folder called "partials". Ideally when the grunt