Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gluestick-env-expose-ast

Package Overview
Dependencies
Maintainers
6
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gluestick-env-expose-ast

Expose strategy for environment variables from AST for Gluestick

  • 4.6.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
6
Created
Source

gluestick-env-expose-ast

This plugin allows you to automatically export environment variables (process.env.*) by taversing the AST of a provided file. For example, if the plugin finds process.env.ENV_VAR_0 this variable will be exposed in the final build, both on client and server.

How to use

  1. Install plugin
npm install --save gluestick-env-expose-ast
  1. Define (and configure) plugin in src/gluestick.plugins.js:
export default [
  'gluestick-env-expose-ast'
]

// or

export default [
  {
    plugin: 'gluestick-env-expose-ast',
    options: {
      parse: 'file.js'
    },
  },
]

Configuration

  • parse: string | string[] - path or array of paths to files which will be parsed for process.env.*
  • exposeRuntime: boolean - replace process.env with window.__GS_ENV_VARS__ to allow passing variables in runtime instead of on compilation time, it will also pass detected variables to the server bundle so window.__GS_ENV_VARS__ gets properly propagated when renderering pages on the server

FAQs

Package last updated on 27 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc