Skip to content
Replaces a defined token with the current environment in Brunch.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Jan 25, 2016
LICENSE
README.md
index.js
package.json Initial version. Jan 25, 2016

README.md

🚧 This Plugin Is Deprecated 🚧

This project is deprecated in favor of process.env.NODE_ENV.

environment-brunch

Replaces a defined token with the current environment in your js/ts files in Brunch.

The environment defaults to development if not set.

It will replace the string BRUNCH_ENVIRONMENT by default, but this can be overridden by setting the token config.

module.exports.config = {
  plugins: {
    environment: {
      token: /\$!ENV!\$/g
    }
  }
}

You can also provide a string value and that will work as well. If you provide a regular expression, make sure that you set the g flag to replace all occurences, not just the first one.

The replacement is not wrapped in anything so make sure you account for that in your files.

You can’t perform that action at this time.