balderdashy / sails-hook-subapps

Sails hook for including child Sails apps into a parent app
18 stars 3 forks source link

Hook fail if lodash disabled in config. #1

Closed konstantinzolotarev closed 9 years ago

konstantinzolotarev commented 9 years ago

Getting this error:

/Volumes/Repos/Coding/node/lom.kg/node_modules/sails-hook-subapps/index.js:63
      _.each(sails.config[self.configKey], function(subappConfig) {
      ^
ReferenceError: _ is not defined

If this config used: globals.js

/**
 * Global Variable Configuration
 * (sails.config.globals)
 *
 * Configure which global variables which will be exposed
 * automatically by Sails.
 *
 * For more information on configuration, check out:
 * http://sailsjs.org/#/documentation/reference/sails.config/sails.config.globals.html
 */
module.exports.globals = {

  /****************************************************************************
  *                                                                           *
  * Expose the lodash installed in Sails core as a global variable. If this   *
  * is disabled, like any other node module you can always run npm install    *
  * lodash --save, then var _ = require('lodash') at the top of any file.     *
  *                                                                           *
  ****************************************************************************/

    _: false,

  /****************************************************************************
  *                                                                           *
  * Expose the async installed in Sails core as a global variable. If this is *
  * disabled, like any other node module you can always run npm install async *
  * --save, then var async = require('async') at the top of any file.         *
  *                                                                           *
  ****************************************************************************/

    async: false,

  /****************************************************************************
  *                                                                           *
  * Expose the sails instance representing your app. If this is disabled, you *
  * can still get access via req._sails.                                      *
  *                                                                           *
  ****************************************************************************/

    // sails: true,

  /****************************************************************************
  *                                                                           *
  * Expose each of your app's services as global variables (using their       *
  * "globalId"). E.g. a service defined in api/models/NaturalLanguage.js      *
  * would have a globalId of NaturalLanguage by default. If this is disabled, *
  * you can still access your services via sails.services.*                   *
  *                                                                           *
  ****************************************************************************/

    services: false//,

  /****************************************************************************
  *                                                                           *
  * Expose each of your app's models as global variables (using their         *
  * "globalId"). E.g. a model defined in api/models/User.js would have a      *
  * globalId of User by default. If this is disabled, you can still access    *
  * your models via sails.models.*.                                           *
  *                                                                           *
  ****************************************************************************/

    // models: true
};
sgress454 commented 9 years ago

Thanks! Closed by https://github.com/balderdashy/sails-hook-subapps/commit/8cbd974b181b1aeb907bfb9d7ed22ada5bd9adfa