gruntjs

grunt-bower-install: exclude certain components

我的梦境 提交于 2019-12-21 08:05:18
问题 I just created a new webapp using the angular-fullstack yeoman generator. I noticed that grunt-bower-install is generating the JS bower components in my index.html files between the <!-- bower:js --> tags. <!-- bower:js --> <script src="bower_components/jquery/dist/jquery.js"></script> <script src="bower_components/angular/angular.js"></script> <script src="bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/affix.js"></script> <script src="bower_components/bootstrap

Grunt Copy Flatten not working as expected

馋奶兔 提交于 2019-12-21 07:36:27
问题 I have a directory structure as follows: source/ libraries/ d3.js lodash.js //etc I have grunt-copy setup as follows: copy: { main: { files: [ { src: ["source/libraries/*.js"], dest: "build/", flatten: true } I expect it to flatten the output into build, so that I will have build/ d3.js //etc Instead, I get a reproduction of the original directory structure in build: build/ source/ libraries/ d3.js //etc What gives? Am I not using flatten properly? 回答1: Well, if you're only using flatten

How to compile multiple scss files using grunt-sass

旧城冷巷雨未停 提交于 2019-12-21 06:48:59
问题 I am trying to compile multiple .scss files into a single CSS file. This actually works but only grabs the first file... sass: { // Task dist: { files: { 'css/test.css':'sass/*.scss' } } } We don't have ruby installed so grunt-contrib-sass is not an option. I do the same thing in Stylus like this... stylus: { compile : { files : { 'css/g.css' : 'stylus/*.styl' } } } 回答1: What about running grunt-contrib-concat first? concat: { dist: { src: [ 'sass/*.scss', ], dest: 'sass/build.scss', } },

React and Grunt - Envify NODE_ENV='production' and UglifyJS

喜夏-厌秋 提交于 2019-12-21 04:35:11
问题 I am using Grunt to build a React project and I want to have 'dev' and 'prod' flavours. As react docs says: To use React in production mode, set the environment variable NODE_ENV to production. A minifier that performs dead-code elimination such as UglifyJS is recommended to completely remove the extra code present in development mode. I am very new using grunt, browserify and stuff but let's see. First problem I have is with envify, I use it as a transform: browserify: { options: { transform

NPM doesn't install module dependencies when deploying a Grunt app to heroku

最后都变了- 提交于 2019-12-21 04:13:33
问题 I'v made a static single page site using grunt. I'm now trying to deploy it to heroku using the heroku-buildpack-nodejs-grunt for node grunt. Below is a pic of my root directory: Here's my Gruntfile package.json: Procfile : web: node index.html When I run $ git push heroku master it gets to the Gruntfile and fails: -----> Found Gruntfile, running grunt heroku:production task >> Local Npm module "grunt-contrib-uglify" not found. Is it installed? The above errors proceed to list all local NPM

NPM doesn't install module dependencies when deploying a Grunt app to heroku

删除回忆录丶 提交于 2019-12-21 04:13:15
问题 I'v made a static single page site using grunt. I'm now trying to deploy it to heroku using the heroku-buildpack-nodejs-grunt for node grunt. Below is a pic of my root directory: Here's my Gruntfile package.json: Procfile : web: node index.html When I run $ git push heroku master it gets to the Gruntfile and fails: -----> Found Gruntfile, running grunt heroku:production task >> Local Npm module "grunt-contrib-uglify" not found. Is it installed? The above errors proceed to list all local NPM

Webstorm does not recoginize Grunt

喜你入骨 提交于 2019-12-21 04:12:48
问题 So I have messed up with removing and installing node and npm to install packages without sudo and now I can't use Grunt panel in Webstorm The message is: grunt --no-color --gruntfile /Users/max/repos/cb/Gruntfile.js --tasks /Applications/WebStorm.app/plugins/JavaScriptLanguage/grunt_js/tasks _intellij_grunt_tasks_fetcher Cannot run program "grunt" (in directory "/Users/max/repos/cb"): error=2, No such file or directory Looks like the grunt command isn't in your system path. In order to view

Cannot install phantomJS in Karma

女生的网名这么多〃 提交于 2019-12-21 03:11:37
问题 WARN [config]: config.configure() is deprecated, please use config.set() instead. WARN [plugin]: Cannot find plugin "karma-phantomjs". Did you forget to install it ? npm install karma-phantomjs --save-dev INFO [karma]: Karma v0.10.2 server started at http://localhost:9018/ WARN [launcher]: Can not load "PhantomJS", it is not registered! Perhaps you are missing some plugin? Getting this error. When running npm install karma-phantomjs --save-dev I get an error. npm ERR! 404 'karma-phantomjs' is

GruntJS - wrong image paths after grunt build

孤街醉人 提交于 2019-12-21 02:15:12
问题 Grunt is messing my minified CSS and I cannot figure out why and how to avoid it. To be brief, before the minification I have some background images like this: .head-image { height: 380px; background: url("../images/head1_bg.png") repeat-x; -webkit-background-size: cover; background-size: cover; } Then, after the whole process, I have a minified CSS that goes like this (snippet): [...]background:url(/home/domo/projects/lp/.tmp/images/head1_bg.png) repeat-x;background-size:cover}[...] The

How can I skip a grunt task if a directory is empty

╄→尐↘猪︶ㄣ 提交于 2019-12-21 01:27:11
问题 I'm using grunt-contrib's concat and uglify modules to process some javascript. Currently if src/js/ is empty, they will still create an (empty) concat'd file, along with the minified version and a source map. I want to task to detect if the src/js/ folder is empty before proceeding, and if it is, then the task should skip (not fail). Any ideas how to do this? 回答1: The solution may not be the prettiest, but could give you an idea. You'll need to run something like npm install --save-dev glob