Search Posts

Category: gruntjs

gruntfile taskrunner compilation error in angular js 2 project

I am working on project using angular js 2 in VS 2015. I am using webpack and gruntfile. I have a task in task runner which is giving error like this: Running “ts:base” (ts) task Compiling… Using tsc v2.0.6 >> Compilation failed Warning: Task “ts:base” failed. Use –force to continue. Aborted due to warnings. Process terminated with code 3. It is like this When I load the project, it shows these errors in […]

Can’t read environment variables from a Grunt server-run Node + AngularJS app

I’ve created an app on AngularJS and Firebase. I decided to store the Firebase credentials as environment variables. I am on Ubuntu, and I run the development server using Grunt. I tried creating a .bashrc file to store the environment variables as shown below (with the values inserted between the quotes). export APIKEY=”” export AUTH_DOMAIN=”” export DATABASE_URL=”” export STORAGE_BUCKET=”” export MESSAGING_SENDER_ID=”” I then have a config.js file that uses these variables to configure Firebase. var […]

html5 mode with grunt serve not working

In grunt file, livereload block looks like this: livereload: { options: { open: true, middleware: function (connect, options,middleware) { var optBase = (typeof options.base === ‘string’) ? [options.base] : options.base; return [ [require(‘connect-modrewrite’)([‘!(..+)$ / [L]’])].concat({ return connect.static(path); })), connect.static(‘.tmp’), connect().use( ‘/bower_components’, connect.static(‘./bower_components’) ), connect().use( ‘/app/styles’, connect.static(‘./app/styles’) ), connect.static( ]; } } }, Adding: [require(‘connect-modrewrite’)([‘!(..+)$ / [L]’])].concat({ return connect.static(path); })), did use to work for me to enable html5 mode, otherwise, my routes do […]

Grunt uglify using babel not working es6

For the past day I have been struggling with minifying my angularJs file. The file is in es6 format. The angularJs file var myApp = angular.module(‘myApp’, [‘ui.router’, ‘testData’]); angular.element(document).ready(() => { = xxx(‘path’);{ onLoad: ‘login-required’ }) .success((authenticated) => { //code }) .error(function() { window.location.reload(); }); }); myApp.config(function($stateProvider, $urlRouterProvider, $httpProvider) { $httpProvider.interceptors.push(‘authInterceptor’); //ui router code }); myApp.factory(‘authInterceptor’, function($q, Auth) { return { request: function (config) { //code return deferred.promise; } }; }); The package.json […]

How to load css file from bower component

I am using grunt in my angularjs one project. I have created the project using yeoman. I have used emojionearea emojis in my project the link is here. According to docs css and js file should me included in project. I have installed the package and include it in my bower.json file like here “dependencies”: { “angular”: “^1.5.0”, “bootstrap”: “^3.2.0”, “angular-animate”: “^1.5.0”, “emojionearea”: “3.0.0” }, when I try to run the project using grunt serve […]