Search Posts

Category: gruntjs

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( optBase.map(function(path){ 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(appConfig.app) ]; } } }, Adding: [require(‘connect-modrewrite’)([‘!(..+)$ / [L]’])].concat( optBase.map(function(path){ 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(() => { window.xxx = xxx(‘path’); window.xxx.init({ 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 […]