Skip to content

Use DI to prevent multiple copies of @babel/core#664

Merged
developit merged 2 commits intomasterfrom
babel-core-dupes
Jun 19, 2020
Merged

Use DI to prevent multiple copies of @babel/core#664
developit merged 2 commits intomasterfrom
babel-core-dupes

Conversation

@developit
Copy link
Copy Markdown
Owner

@developit developit commented Jun 19, 2020

Here's the difference:

This uses the copy of @babel/core that is being used to transform and run plugins:

export function custom(core) {
  return {
    config() {
      core.createConfigItem(...)
    }
  }
}

This uses the copy of @babel/core that npm installed for Microbundle, which may be different:

import core from '@babel/core';
export function custom() {
  return {
    config() {
      core.createConfigItem(...)
    }
  }
}

Fixes #657.

@developit
Copy link
Copy Markdown
Owner Author

I've manually tested this change in 2 broken projects and it works!

@developit developit merged commit 5f8ea9e into master Jun 19, 2020
@developit developit deleted the babel-core-dupes branch June 19, 2020 17:27
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.

(babel plugin) Error: [BABEL] .value is not a valid Plugin property

2 participants