gruntjs

Grunt jade compiler filling out empty attributes

只谈情不闲聊 提交于 2019-12-06 13:40:28
I'm using the grunt-contrib-jade module to compile my Jade templates, if I leave my attribute blank like the following line: article(ui-view) It will compile to: <article ui-view="ui-view"></article> And that will break my AngularJS ui-router, as it will not handle the "ui-view" directive as if it is a named view (not what I want). Of course it's an option to write my jade file like this: article(ui-view='') But that's not what I want, is there some way to stop the jade compiler from filling out empty attributes? Gildor Everything seems good when there's doctype html at the beginning of the

Grunt Server: Not supporting CORS, gives error

点点圈 提交于 2019-12-06 13:19:02
I have a server setup and everything was going fine but I am getting errors about .... is not allowed by Access-Control-Allow-Origin This is very strange as both the grunt server that hosts my Angular.js site is on port 9000 and my rest service is on port 8678. Anyway I found this https://gist.github.com/Vp3n/5340891 which explains how to enable CORS on the grunt server but my grunt file doesn't look the same... this is my current part of my grunt file connect: { options: { port: 9000, // Change this to '0.0.0.0' to access the server from outside. hostname: 'localhost' }, livereload: { options

Grunt: jit-grunt: Plugin for the “protractor” task not found

谁说我不能喝 提交于 2019-12-06 13:17:21
I am new to yeoman/grunt/bower and I am working on setting up a angularjs project with: yo angular I made some changes to gruntfile myself and recently I found protractor very useful and I wanted to add that to my project. I followed a lot of instructions online (like this one Integrating Protractor with Yeoman via Grunt 2 years ago) but I still cannot get protractor properly installed. Here is my Gruntfile.js : (only showed relevant parts) 'use strict'; module.exports = function (grunt) { // Time how long tasks take. Can help when optimizing build times require('time-grunt')(grunt); //

grunt.file.copy exclude empty folders

五迷三道 提交于 2019-12-06 12:45:01
file.copy (actually grunt-config-copy but it uses grunt.file.copy underneath). This is working fine for me but I'm excluding certain glob patterns. This exclusion results in some empty folders, and the folders are still copied to new set. Is there any way to exclude empty folders? Thanks, Raif here is my grunt-task copy: { release: { expand: true, deleteEmptyFolders:true, cwd:'<%= srcFolder %>', src: ['**', '!**/obj/**', '!**/*.cs', '!**/*.vb', '!**/*.csproj', '!**/*.csproj.*' ], dest: '<%= destFolder %>', filter: function(filepath) { var val = !grunt.file.isDir(filepath) || require('fs')

Grunt keeps removing my absolute paths

拜拜、爱过 提交于 2019-12-06 09:47:53
I have references to some external JS files in my index.html like this: <!-- build:js(app) /scripts/vendor.js --> <!-- bower:js --> <script src="/bower_components/jquery/jquery.js"></script> <script src="/bower_components/angular/angular.js"></script> <script src="/bower_components/jquery-ui/ui/jquery-ui.js"></script> <!-- endbower --> <!-- endbuild --> Every time I run grunt serve ( generator-angular-fullstack ), the initial slashes are removed ( "/bower_components/..." → "bower_components/..." ), which ruins my pages >1 steps down in the hierarchy. Is there a quick fix? From https://github

Grunt Watch Fatal error: listen EACCES and livereload

徘徊边缘 提交于 2019-12-06 09:45:09
问题 PC Specs: Windows 7 Enterprise x64 I'm running grunt.js on a project and recently started receiving an error when attempting to run 'grunt watch'. Grunt worked fine yesterday but today I started seeing: Running "watch" task Waiting...Fatal error: listen EACCES I read another question here: Cloud 9 and Grunt.js that lead me to remove 'options: {livereload: true}' from Gruntfile.js running watch again works as intended. Is there a way to reconfigure grunt or livereload to get livereload working

AngularJS with Grunt - Connect to another server

夙愿已清 提交于 2019-12-06 09:04:59
问题 I have created an AngularJS application using grunt, bower and yeoman. I guess the Gruntfile.js has changed after 2014 January (not sure). Here is my gruntfile.js // Generated on 2014-04-03 using generator-angular 0.8.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' module.exports = function (grunt) { // Load grunt tasks automatically require

heroku — npm postinstall script to run grunt task depending on enviro

房东的猫 提交于 2019-12-06 07:49:34
问题 I've got two heroku node.js apps, one for prod and one for dev, and I also have a Gruntfile with dev- and prod-specific tasks. I know you can set up package.json to run grunt as a postinstall hook for npm, but can you specify somehow different tasks to be run depending on what enviro you're in? Here's what the relevant section of my package.json looks like so far: "scripts": { "postinstall": "./node_modules/grunt/bin/grunt default" }, Rather than run grunt default every time, I'd love to run

How to avoid multiple helper implementations like __indexOf() with grunt-contrib-coffee

大城市里の小女人 提交于 2019-12-06 07:23:14
问题 I have a Gruntfile.coffee that has a grunt-contrib-coffee configuration like this: coffee: compile: files: 'public/assets/application.js': [ 'multiple/files' #, ... ] options: bare: true The Problem is, that it generates multiple implementations of helper methods like var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; How to make it recognize that these implementations are already compiled?

Running grunt-contrib-jshint only on recently modified files

本小妞迷上赌 提交于 2019-12-06 06:08:36
问题 We're going through refactoring the code on a very large site. I would like to enforce linting on any files that get changed, but ignore the rest (as many of them will end up being removed so it's a waste of time to tidy them up). I would like to have a grunt task that checks that a file's modified date is more recent than its created (*fetched from repo) date and lints it if this is the case (would be good also to have grunt update a json list of files to be linted). I haven't used node much