FAQ Database Discussion Community


Yeoman angular grunt-serve vs http-serve

angularjs,gruntjs,npm,yeoman,http-server
I've just used Yeoman to create an Angular project that looks great when I run grunt serve. But then I decided to view it by running http-server, and the page gets displayed without the formatting and without the images. Does anyone know why that is and if I'll run into...

Why are my SVG icons clipped when using grunt svg sprite?

html,css,svg,gruntjs
I am using grunt-svg-sprite module (https://www.npmjs.com/package/grunt-svg-sprite) to create a sprite with the view mode and symbol mode as shown below: svg_sprite: { svg_icons: { expand: true, cwd: 'src/app/assets/artwork/svgs', src: ['**/*.svg'], dest: 'src/app/assets/artwork', options: { shape: { spacing: { // Spacing related options padding: 1, // Padding around all shapes box:...

Meteor Not Excluding Node Modules in the Private Folder?

javascript,node.js,meteor,gruntjs,isobuild
I'm adding my own grunt build setup to my meteor project and assumed from the docs that if I put it into the private folder, it would be left alone by iso-build. Alas this is not the case, and all manner of hell breaks loose. I'd like to know why?...

How to setup grunt-babel to transpile an entire directory

gruntjs,babel,transpiler
So I have this in my gruntfile: gruntConfig.babel = { options: { sourceMap: true }, dist: { files: { "dist/server.js": "src/*.js" } } }; This correctly transpiles all the js files in src, but it overwrites dist/server.js every time. This must be really simple, but I can't seem to figure...

Add locale moment to an AngularJS app

angularjs,gruntjs,momentjs
I'm trying to configure the locale language for an AngularJS app based on Yeoman. When I serve the dist package after building my app (grunt build), the script reference dissapears. Here's a list of my dependencies on the index.html file. <!-- build:js(.) scripts/vendor.js --> <!-- bower:js --> <script src="bower_components/jquery/dist/jquery.js"></script> <script...

When using Libsass/Grunt is there a way to watch files on the fly?

css,sass,gruntjs,zurb-foundation-5,libsass
I have installed Foundation 5 using >gem install foundation And then creating a new project using the command >foundation scratch --libsass The main reason being is that I'm on Windows and I really don't need/want to be using compass. I know that after I make changes to my sass files...

Strange npm behavior when installing packages like grunt

node.js,gruntjs,npm,gulp,bower
I run the following command in my bash and I get the related results: [email protected]:~$ sudo npm install -g grunt-cli /usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt [email protected] /usr/local/lib/node_modules/grunt-cli ├── [email protected] ├── [email protected] ([email protected]) └── [email protected] ([email protected], [email protected]) and [email protected]:~$ grunt /usr/bin/env: node: No such file or directory I also have try to install...

generating templates with grunt - looking for a task

javascript,node.js,templates,gruntjs,task
I've got an HTML file with following content: <html> <body> <span>{{ secret }}</span> </body> </html> I'm looking for a grunt task that could take this source file, take a map of values: grunt.initConfig({ myTask: { myTarget: { src: ... dest: ... values: { secret: 'ABC' } } } }) and...

Getting undefined with custom function execution in grunt task

gruntjs
Try to execute below custom task: 'use strict'; module.exports = function(grunt) { grunt.initConfig({ log: { one: [1, 2, 3], two: "Hello World", three: true, four: { five: function() { grunt.log.writeln("Hi"); }, six: function() { grunt.log.writeln("Welcome"); } } } }); grunt.registerMultiTask('log', 'Log stuff', function() { grunt.log.writeln(this.target + ": " + this.data...

How to use dynamic values in Grunt tasks called from inside a forEach?

foreach,gruntjs,grunt-contrib-copy
We are trying to run grunt tasks using grunt.config.set for dynamically concatinated strings. These grunt.configs are set in a forEach loop and change each time before the task is run. This does unfortunately not work, as grunt only uses the last grunt.config.set and runs it multiple times with that very...

How do I create a deploy git branch for my Yeoman project?

git,deployment,gruntjs,yeoman,branching-and-merging
I created a new project using Yeoman. Using Grunt I've created the dist directory. My whole project is on Github, https://github.com/d3a1i0/mykungfuisstrong.com, and I've created a prod branch. My question is how do I get my prod branch to have only the contents of dist instead of having the dist directory...

Visual Studio 2015: Destination wwwroot/css/site.css not written because no source files were found.

gruntjs,visual-studio-2015
I'm trying to use grunt in my ASP project, but for whatever reasons have get a stupid warning-message from Visual Studio. How you can see down, the bower-task has been executed, but haven't uglify- and less-tasks. Gruntfile.js and folder "wwwroot" are in the same folder. What's wrong ? This is...

Asynchronous tasks in grunt.registerTask

gruntjs,karma-runner
I need to call two functions within grunt.registerTask, but the second function has to be called after the first function is done. So I was wondering if we can use callbacks or promises or other asynchronous mechanisms within grunt.registerTask. (More specifically, I need to launch karma in my first function...

What does slash dot refer to in a file path?

windows,git,gruntjs,filepath,slash
I'm trying to install a grunt template on my computer but I'm having issues. I realized that perhaps something different is happening because of the path given by the Grunt docs, which is %USERPROFILE%\.grunt-init\ What does that . mean before grunt-init? I've tried to do the whole import manually but...

Sailsjs with angularjs npm install error

angularjs,gruntjs,npm,sails.js
i am using sails js backend and frontend angularjs. i have given npm install. npm install package show this error: npm ERR! peerinvalid The package grunt does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer [email protected] wants [email protected]~0.4.0 npm ERR! peerinvalid Peer [email protected] wants [email protected]>=0.4.0 npm ERR! peerinvalid...

Grunt grunt-contrib-cssmin runs unending doesn't combine files

node.js,gruntjs,grunt-contrib-cssmin
I am having a strange issue with grunt-contrib-cssmin. It never stops or gives errors. I am using C:\projects\doeclf>grunt --version && node --version && npm --version grunt-cli v0.1.13 grunt v0.4.5 v0.12.4 2.10.1 My grunt.js has following in it cssmin: { target: { files: [{ expand: true, cwd: 'css/', src: ['index.css', '!*.min.css'],...

Grunt inject CSS file into