mobilehero-archive / adamantium

:end: No longer Maintained -- Use {nativeloop} now: https://github.com/nativeloop
Other
8 stars 0 forks source link

Add ability to run babeljs transform on javascript files in project #11

Closed brentonhouse closed 8 years ago

brentonhouse commented 8 years ago

As a developer, I want to be able to run babeljs presets on my javascript files before they are parsed by uglifyjs, So that I can make javascript code ES5 compliant so it can be parsed by uglifyjs without error.

Technically, this is possible already using alloy.jmk but it would be very nice to have a built-in way of running babeljs.

Idea is to have an additional property in the the config.json file called babeljs. Under babeljs would be a property options. This object would be passed without modification to babel.tranform(code, [options])

Example

{
    "global": {},
    "env:development": {},
    "env:test": {},
    "env:production": {},
    "os:android": {},
    "os:blackberry": {},
    "os:ios": {},
    "os:mobileweb": {},
    "os:windows": {},
    "dependencies": {},
    "babeljs": {
        "options": {
            "presets": [
                "es2015"
            ]
        }
    }
}