@nuxtjs/separate-env
[![npm (scoped with tag)](https://img.shields.io/npm/v/@nuxtjs/separate-env/latest.svg?style=flat-square)](https://npmjs.com/package/@nuxtjs/separate-env) [![npm](https://img.shields.io/npm/dt/@nuxtjs/separate-env.svg?style=flat-square)](https://npmjs.com
Last updated 2 years ago by mannil .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @nuxtjs/separate-env 
SYNC missed versions from official npm registry.

Separate env module - Tear your variables apart!

npm (scoped with tag) npm Build Status codecov Dependencies js-standard-style

???? Release Notes

Features

  • Separated environment variables for server and client build
  • Thoroughly tested!

Setup

  • Add @nuxtjs/separate-env dependency to your project using yarn or npm

Configuration

To define environment variables only available on server/client side, use the env key of your nuxt.config.js and nest the variables in a server or client object:

{
  env: {
    server: {
      ONLY_SERVER: 'yup',
      DIFFERENT_ON_BOTH: 'server'
    },
    client: {
      ONLY_CLIENT: 'okay',
      DIFFERENT_ON_BOTH: 'client'
    },
    normalEnvVariableThatWillBeAvailableEverywhere: 'Hi'
  }
}

That's it! You are good to go.

Caveats

IMPORTANT: Be aware that server-side includes every first render of your application. Your secret tokens won't be included anywhere **except you use them **

Development

  • Clone this repository
  • Install dependencies using yarn install or npm install
  • Start development server using npm run dev

License

MIT License

Copyright (c) Alexander Lichter

Current Tags

  • 0.0.1                                ...           latest (2 years ago)

1 Versions

  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (19)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |