Skip to content

Compile plugin code for older NodeJS versions #7

@jessevdp

Description

@jessevdp

Gatsby's supports all nodeJS versions starting from v8.0.0. This plugin currently uses some JS language features that aren't actually supported in node 8. To make sure the plugin is compatible with the node version of all Gatsby users, the plugin code should be "compiled". Babel is the standard tool to do this.

There is a babel preset (babel-preset-gatsby-package) used by all of Gatsby's internal packages.

For example, the gatsby-source-contentful plugin uses this babel preset. (See it's package.json.) The code for this plugin uses many of the same JS features (like let/const, arrow function, async/await).


Perhaps we should also specify the engines (nodeJS version) in the package.json of this plugin too. Other plugins seem to do this.

"engines": {
    "node": ">=8.0.0"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions