gruntjs

Gulp Env and Preprocess

∥☆過路亽.° 提交于 2019-12-13 12:08:23
问题 In Grunt I used to use a plugin called env . That would allow me to define an environment in specific build. I had 3 builds. One was DEV which would use all the files split up individually. PROD would concat everything and RELEASE would concat and uglify. I'm looking to do the same in Gulp. I do see a preprocessor for Gulp but nothing to define environment. The question is. What can I do? Obviously I don't want to define all JS files all the time, and I don't want 3 different HTML pages with

Yeoman, Grunt, AngularJS and error 404 on POST form

与世无争的帅哥 提交于 2019-12-13 07:37:45
问题 I am trying to send a form with "POST" method with AngularJS. I use $http to send it but it always return "Cannot POST" and 404 error. The route is correct and only happens if I execute my app via Grunt (sending by "GET" works perfect). The app has been built using Yeoman. I think that it has to be a silly problem but I cannot make it work. The view: <form name="formLogin" ng-submit="login()"> <ul> <li> <label for="user">User</label> <input type="text" id="user" name="user" ng-model="user"> <

Using Regex in grunt-contrib-copy's “process” option not working

与世无争的帅哥 提交于 2019-12-13 05:46:15
问题 I'm trying to remove my live reload script from my index.html file dynamically using Grunt's copy plugin. The part of my Gruntfile with the code in question is here: copy: { main: { files: [ { expand: true, src: 'index.html', dest: 'build/', options: { process: function (content, srcpath){ return content.replace(/<script src = "http:\/\/localhost:9090\/livereload.js"><\/script>/g, " "); } } }, I checked a regex tester and it showed that the regular expression I have above should match the

Karma reporter with Grunt prints [object Object] instead of describe strings

我是研究僧i 提交于 2019-12-13 05:14:27
问题 With grunt, my failing tests output like so: Chrome 37.0.2062 (Mac OS X 10.9.5) [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] should return full list if no filter options are set FAILED When I run the tests without grunt,

Javascript automation for files move into another folder

让人想犯罪 __ 提交于 2019-12-13 05:13:02
问题 I have a folder in my server which contains some files. These are automated that means everyday we get new files automatically which will overwrite the old ones. So want to take a back up for this data. How can i copy all these files in to a another folder by renaming the files with current date while copying. Ex : I have a folder named folder1 which contains 4 files. Path for this folder is home/webapps/project1/folder1 aaa.csv bbb.csv ccc.csv ddd.csv Now I want to copy all these four files

Merging two bower.json files with similar attributes (merging two JSON files with similar attributes)

故事扮演 提交于 2019-12-13 04:50:58
问题 I want to merge two bower.json files. One is local to my project and the other one is shared between different projects. I need to merge these two files before running bower install. Please check the example for my requirements: Local bower.json { "name": "myLocalProject", "version": "0.0.1", "devDependencies": { "angular": "1.1.0" }, "dependencies": { "components-font-awesome": "*" }, "resolutions": { "angular": "1.3.15" } } and shared bower.json { "name": "sharedBowerFile", "version": "0.0

Node.js server debuging with WebStorm (grunt)

随声附和 提交于 2019-12-13 04:38:56
问题 I'm using grunt to launch my server with livereload and other tasks. I've followed this and this post to run my grunt tasks. It's working but I can't debug properly (when I set some breakpoints, there aren't hit) When I launch the script, here is what I got: As you can see the debugger appears in a 2nd tab, but it's not doing anything. (even if it says it's connected successfully). To debug my app I've to stop this 2nd tab, and run a remote debugger... Anyway to fix this? Additional info: The

Install grunt-phonegap - Error: No compatible version found: URIjs@'^1.12.0'

假如想象 提交于 2019-12-13 04:34:50
问题 I was trying to install grunt-phonegap npm install grunt-phonegap And got this error npm http 304 https://registry.npmjs.org/URIjs npm ERR! Error: No compatible version found: URIjs@'^1.12.0' npm ERR! Valid install targets: npm ERR! ["1.4.2","1.6.3","1.7.0","1.7.1","1.7.2","1.7.3","1.7.4","1.8.0","1.8.1","1.8.2","1.8.3","1.9.0","1.9.1","1.10.0","1.10.1","1.10.2","1.11.0","1.11.1","1.11.2","1.12.0"] I've answered to my question, but it's just a temporary solution which doesn't explain the real

Grunt Exiting When It Should Be Watching

雨燕双飞 提交于 2019-12-13 04:02:09
问题 I am developing a node app that interacts with IRC. My Gruntfile.js : module.exports = function(grunt) { grunt.initConfig({ watch: { js: { files: [ 'index.js', 'brains.js', 'lib/*.js' ], tasks: ['develop'], options: { nospawn: true } } }, develop: { server: { file: 'index.js' } } }); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-develop'); grunt.registerTask('default', ['develop']); }; When I execute grunt it states that it completed and exits. How can I keep grunt

conflicting sass / compass versions

旧城冷巷雨未停 提交于 2019-12-13 03:43:54
问题 I've inherited a project and am having problems setting up the sass/compass workflow. Google search didn't yield any useful info on this. I've got the following: $ cat /etc/*-release DISTRIB_ID=LinuxMint DISTRIB_RELEASE=15 DISTRIB_CODENAME=olivia DISTRIB_DESCRIPTION="Linux Mint 15 Olivia" NAME="Ubuntu" VERSION="13.04, Raring Ringtail" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 13.04" VERSION_ID="13.04" $ ruby --version ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] $ gem list ***