How to use the ember-get-config.modulePrefix function in ember-get-config

To help you get started, we’ve selected a few ember-get-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github poteto / ember-changeset-validations / addon / utils / get-messages.js View on Github external
/* globals requirejs, requireModule */
import { A as emberArray } from '@ember/array';

import { isPresent } from '@ember/utils';
import config from 'ember-get-config';
import defaultMessages from 'ember-changeset-validations/utils/messages';
import withDefaults from 'ember-changeset-validations/utils/with-defaults';

const { keys } = Object;
const moduleName = `${config.modulePrefix}/validations/messages`;

let cachedRef = null;

/**
 * Find and load messages module on consuming app. Defaults to addon messages.
 * To define a custom message map, create `my-app/app/validations/messages.js`
 * and export an object.
 *
 * @param  {Object} moduleMap
 * @param  {Boolean} useCache Pass `false` to ignore cached key
 * @return {Object}
 */
export default function getMessages(moduleMap = requirejs.entries, useCache = true) {
  let messagesModule = defaultMessages;

  if (useCache && isPresent(cachedRef)) {
github affinity-engine / affinity-engine / addon / utils / gather-modules.js View on Github external
export default function gatherModules(subRoute) {
  const modulePrefix = config.modulePrefix;
  const paths = Object.keys(requirejs.entries);
  const regexp = new RegExp(`${modulePrefix}\/${subRoute}\/(.*)`);

  return paths.filter((path) => {
    return regexp.test(path);
  }).reduce((modules, path) => {
    const moduleName = regexp.exec(path)[1];
    const module = requirejs(`${modulePrefix}\/${subRoute}\/${moduleName}`).default;

    modules.set(moduleName, module);

    return modules;
  }, new Map());
}
github duizendnegen / ember-cli-lazy-load / addon / services / bundle-loader.js View on Github external
Object.keys(config.bundles).forEach((key)=>{
            if(bundleMapKey.indexOf(key) > -1){
                config.bundles[key].url = jsonObj[key];
            }else {
                return '/assets/' + config.modulePrefix + "." + key + '.bundle.js';
            }
        });
github MiguelMadero / ember-cli-bundle-loader / addon / resolver.js View on Github external
genericModuleNameLookupPatterns.forEach(function(genericLookupPattern) {
  packageNames.concat(config.modulePrefix).forEach(function(packageName) {
    lookupFunctions.push(function(parsedName) {
      return genericLookupPattern.call(this, packageName, parsedName);
    });
  });
});
github ciena-frost / ember-frost-bunsen / addon / utils.js View on Github external
.map((module) => {
      return module
        .replace(`${config.modulePrefix}/models/`, '')
        .replace(`${config.podModulePrefix}/models/`, '')
    })
    .indexOf(modelName) !== -1