gruntjs

Running grunt task multiple times until it fails

烂漫一生 提交于 2019-12-25 07:46:30
问题 What is the canonical way to run the same grunt task continuously, multiple times until it fails? I'd like to keep the question generic, but here is a specific use case: We have a huge set of end-to-end tests written in Protractor which we run via grunt with the help of grunt-protractor-runner and grunt-contrib-connect. What we'd like to do is to keep the connect task running (the web-server serving from a dist directory) while looping over the protractor until it fails (or/and up to N times)

docpad grunt iteration over all html files

 ̄綄美尐妖づ 提交于 2019-12-25 07:10:06
问题 I am using the docpad-plugin-grunt with several grunt tasks. I wonder what is the best way to run tasks over all docpad generated html documents without individual files to be specified in the gruntfile.js. Is there a routine where docpads handing over to grunt all filenames? Can dopad handle the iteration or is a seperated script needed? 回答1: I don't think grunt is the way to go for this, what you really want to do is hook in to the rendering process that docpad does for each document.

POST requests from grunt-connect-proxy plugin do not contain data

巧了我就是萌 提交于 2019-12-25 06:31:28
问题 It works so far that Angular can make a POST request to my local running Apache server. From that server, I return a Symfony JsonResponse object: $http.post("/api", {"foo":"bar"}) .success(function(data, status, headers, config) { $scope.data = data; console.log(data); }).error(function(data, status, headers, config) { $scope.status = status; }); Now I am stuck with the fact that it only returns [] . If I return a hardcoded associative array, it works. What could be the problem? (plugin) 回答1:

grunt-open for two different files

女生的网名这么多〃 提交于 2019-12-25 04:57:24
问题 grunt-open for two different files I use the grunt-open plugin which works OK. Now I need to open an additional file with a different task . How can I do that? I have tried: open: { file: { path: appPath + '/coverage/lcov/index.html', path2: appPath + '/coverage/lcov-report/index2.html' } } //Here I want to open first line grunt.registerTask('openCoverage', ['exec', 'copy', 'mocha_istanbul', 'open:path']); //Here I want to map second line grunt.registerTask('MochaWeb', ['exec', 'copy',

Bower installs same package different in file structure

徘徊边缘 提交于 2019-12-25 04:23:04
问题 We have a TeamCity build server running on three different buildusers with the same configuration. We have set up a angular/grunt project using yeoman Update 6 Added a bower issue https://github.com/bower/bower/issues/1709 How come bower sometimes installs for example angular-animate with the structure: bower_components/angular-animate/bower-angular-animate-1.3.13/angular-animate.js and sometimes it puts the content of the bower-angular-animate-1.3.13 in the root so the structure looks like

How to start grunt server in Jenkins correct

扶醉桌前 提交于 2019-12-25 04:02:44
问题 I have job in Jenkins where i build web app and start it via command: grunt server but when i do this build in Jenkins dont finishing because server still running in prompt: Running "connect:livereload" (connect) task Started connect web server on localhost:80. Running "open:server" (open) task Running "watch" task So, how can i run grunt server in Jenkins in order to server still run but build finished successfully? 回答1: The grunt server command usually opens a local server via node, that

Retrieving output from Node script in a Grunt task

帅比萌擦擦* 提交于 2019-12-25 02:53:23
问题 I'm fairly new to Grunt, so this might be quite a basic question. I've got a Gruntfile.js that looks like this: /*global module:false*/ module.exports = function (grunt) { grunt.initConfig({ }); grunt.registerTask('default', 'measureText'); grunt.registerTask('measureText', 'Measures size of text', function() { grunt.log.writeln('========================================================================'); grunt.log.writeln('= output of ImageMagick should be on next line: ='); var im = require(

Grunt and UglifyJS in Windows app development - UTF8 problems

*爱你&永不变心* 提交于 2019-12-25 02:47:21
问题 I'm developing a Windows 8/8.1 JavaScript app. It basicallly is a port of our webapp. For deployment, I'm using grunt, grunt-contrib-uglify and grunt-contrib-cssmin (next to some more, but those are not connected to my problem. UglifyJS is used to package all my JS files and libs in a minified bundle for each. For the CSS it's the same using CSSmin. As the Windows app certification forces a UTF-8 encoding with signature (BOM), all my source files are encoded that way. I also did set the grunt

grunt-contrib-handlebars configuration issue

白昼怎懂夜的黑 提交于 2019-12-25 02:34:38
问题 I have an issue with the configuration of "grunt-contrib-handlebars", below is my setup at the moment. handlebars: { compile: { options: { namespace: "my.namespace" }, files: { "<%= dist %>/templates/templates.js": "<%= src %>/templates/*.handlebars" } } } This is what I get at the moment: my.namespace["src/templates/baseTemplate.handlebars"] This is what I want: my.namespace["baseTemplate"] So I can call the templates like this: my.namespace.baseTemplate(templateObj); Is it possible to get

Yeoman vs UrlRouting

你离开我真会死。 提交于 2019-12-25 02:32:46
问题 I see how Yeoman work perfectly for a single-page webapp, but I struggle when I try to make it work for a simple php webpage. I have a simple problem: yeoman deals with caching, by renaming the assets, which is cool. Now let's assume, that your webpage is using UrlRouting, so an url like "/news/12/Puppies" would get redirected to the index.php file. Let's also assume, that you have a function, that will set a correct absolute url to the assets, based on the project root: absoluteUrl(). Your