PostCSS plugin that will replace Templates with environment-specific content
Jeffrey Carpenter 9fab32693c package.json: Bump version from 0.0.2 to 0.0.2-dev.1 1 year ago
.editorconfig Initial commit 3 years ago
.gitignore Initial commit 3 years ago
.npmignore Initial commit 3 years ago
.travis.yml Initial commit 3 years ago
CHANGELOG.md Update changelog for version 0.0.2 3 years ago
LICENSE Initial commit 3 years ago
README.md README.md: Add project fork notice 1 year ago
TODO.md Add TODO.md 1 year ago
index.js Include support for modifying AtRules 2 years ago
npm-shrinkwrap.json package.json: Bump version from 0.0.2 to 0.0.2-dev.1 1 year ago
package.json package.json: Bump version from 0.0.2 to 0.0.2-dev.1 1 year ago
test.js Adjust tests to reflect changes in option-checking 3 years ago

README.md

PostCSS Env Replace Build Status

NOTE: This is a project fork of the upstream project.

PostCSS plugin that will replace Templates with environment-specific content.

.foo {
    background-image: url(env_replace(BASE_URL)/myAwesomeImage.jpg);
}
.foo {
    background-image: url(http://localhost/myAwesomeImage.jpg);
}

Installation

npm install postcss-env-replace --save-dev

Usage

postcss([ require('postcss-env-replace')({
    environment: process.env.ENVIRONMENT || 'dev',
    replacements: {
        BASE_URL: {
            prod: 'http://my.site',
            stage: 'http://stage.my.site',
            ci: 'http://ci.my.site',
            dev: 'http://localhost'
        }
    }
}) ])