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

Ignore .babelrc / Babel 6 compatibility? #44

Closed
bradbarrow opened this issue Jan 2, 2019 · 1 comment
Closed

Ignore .babelrc / Babel 6 compatibility? #44

bradbarrow opened this issue Jan 2, 2019 · 1 comment

Comments

@bradbarrow
Copy link

👋

Loving this so far, thanks for the awesome work you're doing with Playroom.

Overview

I've installed it into an existing project. The project uses it's own .babelrc and webpack.config.js.

I have written a dummy component, and pointed playroom at it:

// playroom/components.js

const React = require('react');

module.exports = {
  Button: ({ children }) => <button>{children}</button>,
};
// playroom.config.js

module.exports = {
  components: './playroom/components',
  outputPath: './playroom/dist',
  title: 'My Playroom',
  widths: [320, 375, 768, 1024],
  exampleCode: `
    <Button>
      Hello World!
    </Button>
  `,
};

This component doesn't require any fancy processing, so I've not added custom webpack config.

The Issue

When I run playroom:start, it appears to use babel by default. It also appears to use my .babelrc by default.

My .babelrc includes some plugins/presets that are compatible with Babel 6 but not 7.

I get the following error:

 ERROR  Failed to compile with 1 errors

 error  in ./playroom/components.js

Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/xxx/xxx/xxx/my-babel-6-preset/lib/index.js

Expected

I figured it would be nice if this could either respect my babel config and support babel 6, OR allow me to ignore my babel config, and provide newer, separate config for Playroom's babelling?

@bradbarrow
Copy link
Author

Nevermind, using my own babel-loader with a babelrc: false option made this work as expected.

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