Skip to content

babel 7 support #387

Description

@jaredh159

As noted here: #386 babel 7 requires that plugins export a function, not an object. Babel 7 looks like it's ready to land very shortly.

Without the modification or the workaround below, you get this error:

Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}

Until something gets merged, a workaround is to inline a function in babel.config.js like this:

const glamor = require('glamor/babel');

module.exports = {
  presets: [
    '@babel/preset-env',
  ],
  plugins: [
    () => glamor, // <-- satisfy babel 7's requirement of plugins being function
  ],
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions