gruntjs

How do bring down a connect server in Grunt?

房东的猫 提交于 2019-12-22 12:07:21
问题 I'm running protractor tests on a connect server, since there is no built in web server as in karma. No problem with that, only karma shuts down its web server once it's done running the tests but there is no such mechanism in protractor. I'd like to run protractor tests on a connect server and then spin up another connect server, potentially with a different configuration. So far I've managed to run another connect server on a different port but I still have the two connect servers running

Grunt - How to update html files references within js files using grunt cache bust?

落花浮王杯 提交于 2019-12-22 11:29:51
问题 In my js files I have references to HTML files, like window.location. I would like grunt cache bust to update that reference and add the hash data, so the loaded page is the right one, the one that uses the right versioned file. For example: window.location = 'myweb.html'; > window.location = 'myweb.html?575a2aa1158af941?575a2aa9658af941'; I can't find any configuration of the cache bust that allows me to write within the js file. In my Gruntfile.js I have added the assets and the scr files

npm install -g grunt-cli failed in Linux

女生的网名这么多〃 提交于 2019-12-22 10:37:03
问题 I try to run next command in Linux : npm install -g grunt-cli The message I get is next: npm http GET https://registry.npmjs.org/grunt-cli npm ERR! Error: failed to fetch from registry: grunt-cli npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12 npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9) npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18) npm ERR! at Request.callback (/usr/lib/nodejs/request

grunt-contrib-handlebars - Output is different than when I run the handlebars npm task

雨燕双飞 提交于 2019-12-22 10:28:13
问题 Thank you in advance for your time and help. I'm trying to precompile handlebars (.hbs) templates using grunt-contrib-handlebars When I run the run task I end up with this: this["JST"] = this["JST"] || {}; this["JST"]["app/templates/err.hbs"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) { this.compilerInfo = [4,'>= 1.0.0']; helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; var buffer = "", stack1, functionType="function", escapeExpression=this

How to make Grunt.js and Meteor.js work together?

让人想犯罪 __ 提交于 2019-12-22 10:17:14
问题 I want to use simple copying and concatenation in my Meteor application. But I faced the problem when Meteor runs all javascript files both on server and client whereas I don't want them to be run anywhere. It's either just config file like Gruntfile.js or partial JS files which I want to process somehow and then put inside client folder. Now, with Gruntfile.js file in the root of application I have this error when trying to launch meteor application: W20130826-14:44:39.921(3)? (STDERR) /home

Grunt uglifym - call stack size exceeded

不打扰是莪最后的温柔 提交于 2019-12-22 09:01:44
问题 I am trying to use uglify with grunt to concat and minify some files. I have already used the npm to install grunt-contrib-uglify . I have the following in my grunt.js file: (I have removed some other tasks for anonymity) module.exports = function(grunt) { 'use strict'; grunt.loadNpmTasks('grunt-contrib-uglify'); uglify: { options: { sourceMap: 'app/map/source-map.js' }, files: { 'app/dist/sourcefiles.min.js': [ 'app/test_js/test.js' ] } } }; I then run: grunt uglify but I keep getting the

selenium webdriver manager update - npm

寵の児 提交于 2019-12-22 08:36:46
问题 I tried to update the selenium webdriver using the "webdriver-manager", but i get the error as, Error: Got error Error: read ECONNRESET from https://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.2.jar Error: Got error Error: read ECONNRESET from https://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.2.jar fs.js:60 throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs ^ Error: EPERM: operation not permitted, unlink

How do I add auto-generated list of files in a directory to a JS file?

余生颓废 提交于 2019-12-22 08:18:51
问题 I'm writing an online game in HTML5. One of the files contains a list of resources which are all in resources/img/ folder. Now I'd like this list to be automatically generated based on contents of this folder, rather than having to update it manually every time I add a new image. I'm pretty sure that Grunt can do this, but I don't know how to configure it properly. What should I do to have Grunt generate something like this? resources = ['a.jpg', 'b.png', 'subfolder/c.png']; 回答1: ng

Gruntfile getting error codes from programs serially

可紊 提交于 2019-12-22 07:04:10
问题 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 回答1: Use grunt.util.spawn : http://gruntjs.com/api/grunt.util#grunt.util.spawn grunt.registerTask('serial'

Is 'El Capitan's' rootless breaking old grunt configs?

不想你离开。 提交于 2019-12-22 06:58:13
问题 After migrating to El Capitan, it seems users are experiencing an issue with grunt installations, possibly related to the rootless changes of El Capitan. In particular, running the grunt --force command results in EPERM errors. The workflow is as follows: Assuming npm has been installed, navigate to the grunt directory with package.json and gruntfile.js and invoke grunt: grunt --force Example Gruntfile.js file contents: module.exports = function(grunt) { // All configuration goes here grunt