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

pass babel options to extraction #226

Closed
wants to merge 3 commits into from

Conversation

djfarly
Copy link

@djfarly djfarly commented Jun 13, 2018

Hey ❤️

We are using extract programmatically (heavily customised) instead of via cli. Because our babel options are only ever known at build time, we cannot use the .babelrc file (we do currently by emitting the file, and deleting it after extraction).
By allowing us to pass down options to babel this alleviates a lot of pain.
I know his is kind of a special use case, but i don't see any downsides of having the option to do it.

There is a failing test case, but i cannot make any sense of it currently – maybe I am to tired.

 FAIL  packages/cli/src/api/extract.test.js
  ● extract › should traverse directory and call extractors

    expect(jest.fn()).toHaveBeenCalledWith(expected)

    Expected mock function to have been called with:
      Did not expect argument 3 but it was called with undefined.

      65 |     expect(babel.extract).not.toHaveBeenCalledWith(
      66 |       path.join("src", "index.html")
    > 67 |     )
      68 |
      69 |     expect(babel.extract).toHaveBeenCalledWith(
      70 |       path.join("src", "components", "Babel.js"),

      at Object.<anonymous> (packages/cli/src/api/extract.test.js:67:27)

Any thoughts? Am I making sense? 😄

Cheers, Jan!

@tricoder42 tricoder42 changed the base branch from master to stable-2.x June 24, 2018 05:58
@tricoder42 tricoder42 closed this in 79a22fe Jul 4, 2018
@tricoder42
Copy link
Contributor

Fixed and released in v2.2.0. Thanks to all involved!

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

Successfully merging this pull request may close these issues.

2 participants