babel-plugin-import-graphql
Advanced tools
Comparing version 2.6.2 to 2.7.0
@@ -54,4 +54,9 @@ "use strict"; | ||
var jsFilename = file.opts.filename; | ||
var _opts$extensions = opts.extensions, | ||
extensions = _opts$extensions === void 0 ? [] : _opts$extensions; | ||
extensions = _toConsumableArray(extensions).concat(['.graphql', '.gql']); | ||
if (importPath.endsWith('.graphql') || importPath.endsWith('.gql')) { | ||
if (extensions.some(function (extension) { | ||
return importPath.endsWith(extension); | ||
})) { | ||
if (opts.runtime) { | ||
@@ -58,0 +63,0 @@ try { |
# ChangeLog | ||
## v2.7.0 (March 3, 2019) | ||
### Features | ||
- Add `extensions` option to allow parsing custom file types like `.prisma` (:clap: @DaBs) | ||
## v2.6.2 (June 29, 2018) | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "babel-plugin-import-graphql", | ||
"version": "2.6.2", | ||
"version": "2.7.0", | ||
"description": "Babel plugin to make .gql/.graphql files importable", | ||
@@ -5,0 +5,0 @@ "author": "A.J. Roberts <detrohutt@gmail.com>", |
[![npm Version](https://img.shields.io/npm/v/babel-plugin-import-graphql.svg)](https://www.npmjs.com/package/babel-plugin-import-graphql) | ||
[![npm Downloads](https://img.shields.io/npm/dt/babel-plugin-inline-import-graphql-ast.svg)](https://www.npmjs.com/package/babel-plugin-inline-import-graphql-ast) | ||
[![npm Downloads](https://img.shields.io/npm/dm/babel-plugin-import-graphql.svg)](https://www.npmjs.com/package/babel-plugin-import-graphql) | ||
[![npm License](https://img.shields.io/npm/l/babel-plugin-import-graphql.svg)](https://www.npmjs.com/package/babel-plugin-import-graphql) | ||
@@ -186,3 +186,5 @@ [![donate](https://img.shields.io/badge/donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3AYURHRU7PMCL) | ||
`runtime` | Boolean | false | **Enabling this option requires `graphql-tag` to be installed as a peerDependency.** -- Instead of inlining the parsed AST object, which is very large, this option inlines your GraphQL source code along with an import of the `gql` function from `graphql-tag` and parses your GraphQL source code with `gql` at runtime. | ||
`extensions` | Array | [] | Enables loading GraphQL SDL files that have a custom extension, e.g. '.prisma' | ||
## For users of create-react-app | ||
@@ -189,0 +191,0 @@ |
36477
425
198