github.com/manicqin/nomad@v0.9.5/ui/config/environment.js (about)

     1  /* eslint-env node */
     2  
     3  let USE_MIRAGE = true;
     4  
     5  if (process.env.USE_MIRAGE) {
     6    USE_MIRAGE = process.env.USE_MIRAGE == 'true';
     7  }
     8  
     9  module.exports = function(environment) {
    10    var ENV = {
    11      modulePrefix: 'nomad-ui',
    12      environment: environment,
    13      rootURL: '/ui/',
    14      locationType: 'auto',
    15      EmberENV: {
    16        FEATURES: {
    17          // Here you can enable experimental features on an ember canary build
    18          // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
    19        },
    20        EXTEND_PROTOTYPES: {
    21          // Prevent Ember Data from overriding Date.parse.
    22          Date: false,
    23        },
    24      },
    25  
    26      APP: {
    27        blockingQueries: true,
    28        mirageScenario: 'smallCluster',
    29        mirageWithNamespaces: true,
    30        mirageWithTokens: true,
    31        mirageWithRegions: true,
    32      },
    33    };
    34  
    35    if (environment === 'development') {
    36      // ENV.APP.LOG_RESOLVER = true;
    37      // ENV.APP.LOG_ACTIVE_GENERATION = true;
    38      // ENV.APP.LOG_TRANSITIONS = true;
    39      // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
    40      // ENV.APP.LOG_VIEW_LOOKUPS = true;
    41  
    42      ENV['ember-cli-mirage'] = {
    43        enabled: USE_MIRAGE,
    44        excludeFilesFromBuild: !USE_MIRAGE,
    45      };
    46    }
    47  
    48    if (environment === 'test') {
    49      // Testem prefers this...
    50      ENV.locationType = 'none';
    51  
    52      // keep test console output quieter
    53      ENV.APP.LOG_ACTIVE_GENERATION = false;
    54      ENV.APP.LOG_VIEW_LOOKUPS = false;
    55  
    56      ENV.APP.rootElement = '#ember-testing';
    57      ENV.APP.autoboot = false;
    58  
    59      ENV.browserify = {
    60        tests: true,
    61      };
    62  
    63      ENV['ember-cli-mirage'] = {
    64        trackRequests: true,
    65      };
    66    }
    67  
    68    // if (environment === 'production') {
    69    // }
    70  
    71    return ENV;
    72  };