babel-plugin-modular-graphql
Advanced tools
Comparing version 0.1.1 to 0.1.2
module.exports = function babelPluginModularGraphql({ types: t }) { | ||
const importMap = require('./import-map.json'); | ||
const importMapOverrides = require('./import-map-overrides.json'); | ||
const PKG_NAME = 'graphql'; | ||
@@ -15,3 +16,8 @@ | ||
const imported = specifier.imported.name; | ||
const declaration = importMap[imported]; | ||
let declaration = importMap[imported]; | ||
if (importMapOverrides[imported]) { | ||
declaration = importMapOverrides[imported]; | ||
} | ||
const from = declaration ? declaration.from : PKG_NAME; | ||
@@ -18,0 +24,0 @@ if (!acc[from]) { |
{ | ||
"name": "babel-plugin-modular-graphql", | ||
"description": "Modular GraphQL.js import paths without the hassle", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "author": "Phil Pluckthun <phil@kitten.sh>", |
25107
803