diff --git a/packages/graphql/README.md b/packages/graphql/README.md index 15e920849..bff097da7 100644 --- a/packages/graphql/README.md +++ b/packages/graphql/README.md @@ -13,7 +13,7 @@ ## Requirements -This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+. +This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v2.78.0+. ## Install diff --git a/packages/graphql/package.json b/packages/graphql/package.json index 5091ad522..76c00c109 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -56,7 +56,7 @@ ], "peerDependencies": { "graphql": ">=0.9.0", - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + "rollup": "^2.78.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { diff --git a/packages/graphql/src/index.js b/packages/graphql/src/index.js index 1dd47ee01..015089254 100644 --- a/packages/graphql/src/index.js +++ b/packages/graphql/src/index.js @@ -11,26 +11,31 @@ export default function graphql({ include, exclude } = {}) { return { name: 'graphql', - transform(source, id) { - if (!filter(id)) return null; - if (!filterExt.test(id)) return null; + transform: { + filter: { + id: filterExt + }, + handler(source, id) { + if (!filter(id)) return null; + if (!filterExt.test(id)) return null; - // XXX: this.cachable() in graphql-tag/loader - const code = toESModules( - loader.call( - { - cacheable() {} - }, - source - ) - ); + // XXX: this.cachable() in graphql-tag/loader + const code = toESModules( + loader.call( + { + cacheable() {} + }, + source + ) + ); - const map = { mappings: '' }; + const map = { mappings: '' }; - return { - code, - map - }; + return { + code, + map + }; + } } }; }