Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

babel 7 support #387

Open
jaredh159 opened this issue Aug 26, 2018 · 0 comments
Open

babel 7 support #387

jaredh159 opened this issue Aug 26, 2018 · 0 comments

Comments

@jaredh159
Copy link

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
  ],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant