Skip to content

mastilver/babel-preset-when

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babel-preset-when Build Status

Conditional babel preset

Install

$ npm install --save babel-preset-when

Usage

Via .babelrc (Recommended)

.babelrc

{
  "presets": [
    "when": {
        "IS_SERVER": {
            "true": {
                "presets": ["es2015-node"]
            },
            "false": {
                "presets": ["es2015"]
            }
        },
        "NODE_ENV=development": {
            "development": {
                plugins: ["rewire"]
            }
        }
    }
  ]
}

Running: IS_SERVER=true babel src will use es-2015-node rather than es2015 and rewire as the default

License

MIT © Thomas Sileghem

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages