Configuration

Introduction

EJS environments are configured using a standard environment.js configuration file. This file must reside in the root directory of a given EJS environment.

Directives

Each environment.js file may include the following directives:

Example

environment.js
module.exports = {
    name: 'My Application',
    version: '1.0',
    apiPath: '/path/to/api',
    layoutNamespace: 'Layout',
    moduleNamespace: 'Module',
    pluginNamespace: 'Plugin',
    registeredModules: [
        {
            name: 'MyModule',
            pathPrefix: '/mymodule'
        },
        {
            name: 'Sandbox',
            pathPrefix: '/sandbox'
        }
    ],
    plugins: [
        'Vue/Directive/i18nDirective',
        'Vue/InstanceMethod/Api',
        'Vue/InstanceMethod/FindRouteByName',
        'Vue/InstanceMethod/GeneratePath',
        'Vue/InstanceMethod/GetRoute',
        'Vue/InstanceMethod/RedirectTo',
        'Vue/InstanceMethod/SetLocale',
        'Vue/InstanceMethod/Translate'
    ],
    flags: {
        'i18n-warnings': false
    },
    contexts: [
        {
            id: 'undergrad',
            conditions: [
                {
                    key: 'orgId',
                    value: 1
                }
            ]
        },
        {
            id: 'postgrad',
            conditions: [
                {
                    key: 'orgId',
                    value: 2
                }
            ]
        }
    ]
};

Last updated