gruntjs

How to add --harmony node flag to grunt-express

我的梦境 提交于 2020-01-02 04:50:34
问题 I'm using grunt-express to do local development. here is my GruntFile.js var path = require('path'); module.exports = function(grunt){ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify:{ options:{ banner:'/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' } }, express:{ server:{ options:{ debug:true, server: path.resolve('app.js') } } }, env : { options:{ }, dev : { NODE_ENV : 'development' }, prod : { NODE_ENV : 'production' } }, mochaTest:{ test:{ options:

Ionic framework - command 'grunt serve' returns 'multiple addresses available' and freezes

蹲街弑〆低调 提交于 2020-01-02 04:49:05
问题 Used Yeoman ionic-generator https://github.com/diegonetto/generator-ionic Where I ran it without sass, default plugin list and blank. And when running grunt serve I get the following: Multiple addresses available. Please select which address to use by entering its number from the list below: 1) 192.168.1.69 (en0) 2) localhost Address Selection: When I type 2 in terminal and return it just hangs there without going further or launching a browser. I have tried also typing localhost or

Yeaoman Grunt imagemin Fatal error: Cannot read property 'contents' of undefined

試著忘記壹切 提交于 2020-01-02 04:16:09
问题 I keep on getting when running grunt build even with a clean Yeoman angular build: yo angular whatever . Warning: Running "imagemin:dist" (imagemin) task Fatal error: Cannot read property 'contents' of undefined 回答1: just update your grunt-contrib-imagemin version. Ex: "grunt-contrib-imagemin": "^0.9.2" to "grunt-contrib-imagemin": "^1.0.0" it's work for me. 回答2: I had to downgrade imagemin and it now all works. npm cache clean && npm install grunt-contrib-imagemin@0.9.1 回答3: I changed in

Getting grunt error on sails lift

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 03:33:04
问题 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

How can I force JSHint running in grunt to always use the --verbose flag

非 Y 不嫁゛ 提交于 2020-01-02 03:16:12
问题 I have a particular JSHint/Grunt setup in which I would like to accomplish the following: Load from a single .jshintrc file to allow my IDE linter to pick up my settings Be able to override single options from the .jshintrc in other grunt tasks Have JSHint always run in verbose mode so that I can always see the warning numbers, without needing to run all of grunt with --verbose The following allows me to load from the .jshintrc and always run in verbose, but does not allow option overrides.

Cannot run program “npm” in directory

眉间皱痕 提交于 2020-01-02 00:52:08
问题 When i am traversing the to src/main/app/ folder structure where i have the package.JSON & gruntfile, i am able to run npm install and grunt command. But when i am trying to run the mvn jetty:run and a property file in the root folder of the project when POM file is present, it is throwing error that it cannot run npm install in the folder structure src/main/app/ . This is the exact error: [INFO] ------------------------------------------------------------------------ [ERROR] Failed to

Grunt connect-modrewrite do not work

*爱你&永不变心* 提交于 2020-01-01 14:36:39
问题 I used generator-angular for create my project. I use HTML5 History. ($locationProvider.html5Mode(true).hashPrefix('!');) For url rewrite I use connect-modrewrite I did all like described in tutorial. Here is my GruntFile.js // Generated on 2013-12-13 using generator-angular 0.6.0 'use strict'; // # Globbing // for performance reasons we're only matching one level down: // 'test/spec/{,*/}*.js' // use this if you want to recursively match all subfolders: // 'test/spec/**/*.js' var

Combine and minify all bower libraries with gruntjs

谁说我不能喝 提交于 2020-01-01 09:57:14
问题 Is there a way to combine and minify all bower installed libraries into 1 file automatically? First I tried the most basic approach: combine all .js files from all subdirectories: uglify: { options: {compress: true}, my_target: { files: { 'vendor.js': ['bower_components/**/*.js'], } } } But this is obviously a bad approach. It also doesn't work because of too many errors. I manually deleted all the files and kept only 1 (main) file that each library has, and it worked. Is there a way to do

How can I zip a folder in grunt?

老子叫甜甜 提交于 2020-01-01 04:44:29
问题 I have a folder "foo" , but in my target folder "target" I want to send zip version of my "foo" folder such as "foo.zip" , I google and found many way for zipping files but not for folder, so how can we zip a whole folder in grunt ? 回答1: The accepted answer was throwing an error in grunt-contrib-compress 0.5.0. Try this instead: compress: { foo: { options: { archive: './foo.zip', mode: 'zip' }, files: [ { src: './foo/**' } ] } } 回答2: From above suggestion I am able to get my answer,We can use

How to manage AngularJS workflow with lots of script files

风格不统一 提交于 2020-01-01 03:29:44
问题 I looked into gruntjs but I'm not sure if it the right tool to solve my workflow problem. I' working on a huge angular project with 30+ js files already into it. Every time I add a new js file, I have to go to index file and add reference in it. Is there any way to automate this process with grunt or any other tool? 回答1: Absolutely! Here are two ways: Yeoman Yeoman is a set of integrated workflow management scripts built on Grunt and Bower that supports automatic scaffolding and compilation.