Skip to content

Instantly share code, notes, and snippets.

@dmitryevseev
Last active December 28, 2015 02:29
Show Gist options
  • Save dmitryevseev/7428655 to your computer and use it in GitHub Desktop.
Save dmitryevseev/7428655 to your computer and use it in GitHub Desktop.
Reproduces conditions for grunt-ng-config to throw: Warning: An error occurred while processing a template (Cannot read property 'js' of undefined).
module.exports = function (grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
src: [
'source/js/**/*.js',
'Gruntfile.js'
],
options: {
curly: true,
immed: true,
newcap: true,
noarg: true,
sub: true,
boss: true,
eqnull: true
},
globals: {}
},
ngconstant: {
options: {
space: ' '
},
development: {
constants: {
API_CONFIG: {
baseUrl: 'http://localhost:8080/bl-server/api'
}
},
dest: 'source/js/env-config.js',
name: 'bl.environment-config',
wrap: 'define(["angular"], function (angular) {\n"use strict";\n<%= __ngModule %>});'
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-ng-constant');
};
{
"author": "bla-bla",
"name": "bla",
"version": "0.2.0",
"homepage": "http://bla",
"licenses": {
"type": "MIT",
"url": "https://raw.github.com/joshdmiller/ng-boilerplate/master/LICENSE"
},
"bugs": "http://bla/bugs",
"repository": {
"type": "git",
"url": "git@github.com:joshdmiller/ng-boilerplate.git"
},
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.4.3",
"grunt-ng-constant": "latest"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment