Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-modular-graphql

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-modular-graphql - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

16

index.js

@@ -1,2 +0,2 @@

export default function({ types: t }) {
module.exports = function babelPluginModularGraphql({ types: t }) {
const importMap = require('./import-map.json');

@@ -25,6 +25,3 @@ const PKG_NAME = 'graphql';

acc[from].specifiers.push(
t.importSpecifier(
t.identifier(localName),
t.identifier(newImportedName)
)
t.importSpecifier(t.identifier(localName), t.identifier(newImportedName))
);

@@ -37,7 +34,4 @@ }

const importFiles = Object.keys(imports);
if (
importFiles.length &&
(importFiles.length !== 1 || importFiles[0] !== PKG_NAME)
) {
path.replaceWithMultiple(importFiles.map(key => imports[key]));
if (importFiles.length && (importFiles.length !== 1 || importFiles[0] !== PKG_NAME)) {
path.replaceWithMultiple(importFiles.map((key) => imports[key]));
}

@@ -48,2 +42,2 @@ },

};
}
};
{
"name": "babel-plugin-modular-graphql",
"description": "Modular GraphQL.js import paths without the hassle",
"version": "0.1.0",
"version": "0.1.1",
"main": "index.js",

@@ -6,0 +6,0 @@ "author": "Phil Pluckthun <phil@kitten.sh>",

# babel-plugin-modular-graphql
A small transform plugin to cherry-pick GraphQL modules so you don’t have to.
Basicaly [babel-plugin-lodash](https://github.com/lodash/babel-plugin-lodash) for [graphql](https://github.com/graphql/graphql-js).
Basically [babel-plugin-lodash](https://github.com/lodash/babel-plugin-lodash) for [graphql](https://github.com/graphql/graphql-js).

@@ -30,1 +30,6 @@ ## Getting Started

```
## Limitations
- The plugin currently does not support `require()`
- The plugin automatically generates an import-map that drills down into `graphql`'s files. This may break if files at a depth of 1–2 change their names.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc