Skip to content

Document (or change) nested arrays for package.json transform field? #65

@mikemaccana

Description

@mikemaccana

From babel/babelify#142, it seems the syntax where individual transforms are specified as arrays is correct.

"browserify": {
    "transform": [
        "brfs",
        [
            "babelify", 
            { 
                "presets": ["es2015"] 
            }
        ]
    ]
}

The syntax for this part:

 [
    "babelify", 
    { 
        "presets": ["es2015"] 
    }
 ]

is odd: the array doesn't seem to be used as an ordered list of items. "babelify" is item 0, {"presets": ["es2015"]} is item 1. What would item 2 be?

If there wouldn't ever be an item 2, and this is simply a map between babelify and babelify's options, wouldn't an object be more logical?

"browserify": {
    "transform": [
        "brfs",
        {
            "babelify": { 
                "presets": ["es2015"] 
            }
        }
    ]
} 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions