Joined February 2012
·

Dimitri De Franciscis

www.megadix.it
·
Milano, Italy
·
·
·

Posted to Customize Bootstrap within MEAN.JS over 1 year ago

Last one... I hope!
There is a problem if running in production, i.e.:

TypeError: Cannot call method 'concat' of undefined

at /config/config.js:76

This is because we removed "assets.lib.css" and "assets.css" from production.js
To fix this we need to modify config/config.js:

module.exports = _.extend(
    require('./env/all'),
    require('./env/' + process.env.NODE_ENV) || {}
);

must be changed to:

module.exports = _.defaults(
    require('./env/all'),
    require('./env/' + process.env.NODE_ENV) || {}
);

So undefined properties are kept.

Posted to Customize Bootstrap within MEAN.JS over 1 year ago

Another HUGE problem is that public/application.js file, who holds AngularJS initialization code and which is created by MeanJS, gets overwritten by ngAnnotate task. This prevents angular from properly initializing!

Solution is:

  • move code from application.js a new file: public/angular-bootstrap.js;
  • in config/env/all.js, change (in "assets.js" path) 'public.application.js' to 'public/angular-bootstrap.js'
Posted to Customize Bootstrap within MEAN.JS over 1 year ago

There is a problem with source mapping, i.e. it gives 404 - found because in application.min.css there is this URL:

/*# sourceMappingURL=public/application.min.css.map */

To fix this, add a configuration to "less.development.options" in "grunt.initConfig":
sourceMapURL: 'application.min.css.map'

This should fix the 404 error

Achievements
47 Karma
0 Total ProTip Views