Merge pull request #6778 from loganfsmyth/use-peerdep

Use the peerDep to load types/template/traverse in plugins
This commit is contained in:
Logan Smyth
2017-11-08 23:05:08 -08:00
committed by GitHub
80 changed files with 141 additions and 116 deletions

View File

@@ -6,8 +6,7 @@
"license": "MIT",
"main": "lib/index.js",
"dependencies": {
"@babel/helper-module-transforms": "7.0.0-beta.31",
"@babel/template": "7.0.0-beta.31"
"@babel/helper-module-transforms": "7.0.0-beta.31"
},
"keywords": [
"babel-plugin"

View File

@@ -1,5 +1,4 @@
import { basename, extname } from "path";
import template from "@babel/template";
import {
isModule,
rewriteModuleStatementsAndPrepareHeader,
@@ -9,6 +8,7 @@ import {
ensureStatementsHoisted,
wrapInterop,
} from "@babel/helper-module-transforms";
import { types as t, template } from "@babel/core";
const buildPrerequisiteAssignment = template(`
GLOBAL_REFERENCE = GLOBAL_REFERENCE || {}
@@ -30,7 +30,7 @@ const buildWrapper = template(`
})
`);
export default function({ types: t }, options) {
export default function(api, options) {
const {
globals,
exactGlobals,