Skip to content
This repository was archived by the owner on Jun 19, 2024. It is now read-only.

Latest commit

 

History

History
73 lines (52 loc) · 1.69 KB

configuration.md

File metadata and controls

73 lines (52 loc) · 1.69 KB

Most likely you will have multiple environments for the application dev, qa, prod. You may want to change some of configuration based on what type of environment your running in.

In your root directory you will find a .env-example. This file should be copied over into .env if not already created. In that file you are able to customize per environment.

Environment Variables

You can pass environment variables through webpack

    // webpack.config.js
    .varieConfig({
        app : {
            someKey : "someValue"
        }
    })

and can access them with :

let version = $config.get("app.version");

Accessing the Configuration

You can access the configuration values by using our helper $config

let value = $config.get("app.name");

You can also set the value:

$config.set("app.name", "My New App Name!");

Path Aliases

Varie comes with some path aliases to help out with development. These are customizable but cannot be removed as internal and plugin providers may use these.

    {
      "@app": "app",
      "@views": "views",
      "@store": "store",
      "@config": "config",
      "@routes": "routes",
      "@models": "app/models",
      "@resources": "resources",
      "@components": "app/components",
    }

To customize the aliases, change the values in the webpack.config.js and tsconfig.json files.

[{.alert} Currently our CLI cannot determine what paths you have set, if your using the CLI please do not change these values]

Custom Varie Path

If your change the location of your Varie instance (ex. /resources/assets/js), inside package.json add a new key :

  ...

  "variePath": "resources/js",

  ...