github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/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      if (process.env.STORYBOOK === 'true') {
    48        ENV.APP.autoboot = false;
    49        ENV.rootURL = '/';
    50      }
    51    }
    52  
    53    if (environment === 'test') {
    54      // Testem prefers this...
    55      ENV.locationType = 'none';
    56  
    57      // keep test console output quieter
    58      ENV.APP.LOG_ACTIVE_GENERATION = false;
    59      ENV.APP.LOG_VIEW_LOOKUPS = false;
    60  
    61      ENV.APP.rootElement = '#ember-testing';
    62      ENV.APP.autoboot = false;
    63  
    64      ENV.browserify = {
    65        tests: true,
    66      };
    67  
    68      ENV['ember-cli-mirage'] = {
    69        trackRequests: true,
    70      };
    71    }
    72  
    73    // if (environment === 'production') {
    74    // }
    75  
    76    return ENV;
    77  };