{"_id":"@benjie/persistgraphql-webpack-plugin","_rev":"5-b9c34836c49e25ba1acc2e1d3b2bb525","name":"@benjie/persistgraphql-webpack-plugin","description":"PersistGraphQL Webpack Plugin","dist-tags":{"latest":"0.4.0-alpha.3"},"versions":{"0.3.3-alpha.1":{"name":"@benjie/persistgraphql-webpack-plugin","version":"0.3.3-alpha.1","description":"PersistGraphQL Webpack Plugin","main":"index.js","scripts":{"lint":"eslint --fix .","posttest":"npm run lint","test":"NODE_ENV=coverage nyc --check-coverage --lines 96 --branches 70 npm run tests","tests":"mocha","tests:watch":"DEBUG=webpack-virtual-modules mocha -w"},"repository":{"type":"git","url":"git+https://github.com/sysgears/persistgraphql-webpack-plugin.git"},"keywords":["webpack-plugin","graphql","apollo-client"],"author":{"name":"SysGears INC"},"license":"MIT","bugs":{"url":"https://github.com/sysgears/persistgraphql-webpack-plugin/issues"},"homepage":"https://github.com/sysgears/persistgraphql-webpack-plugin#readme","devDependencies":{"chai":"^4.0.0","eslint":"^4.1.0","memory-fs":"^0.4.1","mocha":"^3.2.0","nyc":"^11.0.2","webpack":"^3.1.0"},"dependencies":{"@benjie/persistgraphql":"^0.3.2-alpha.1","webpack-virtual-modules":"^0.1.7"},"files":["*.js"],"greenkeeper":{},"gitHead":"4fa85f77a144673bc5a9da4d9b98c8b2e07bea1d","_id":"@benjie/persistgraphql-webpack-plugin@0.3.3-alpha.1","_npmVersion":"5.2.0","_nodeVersion":"8.1.2","_npmUser":{"name":"benjie","email":"npm@benjiegillam.com"},"dist":{"integrity":"sha512-tRIqP3x4d9Pvg3wiiYYn+tO2wbYuTUdVMovx5Map+2s45WS1U5oFM/+jdoJtRjcmZTQP5LZHAGg6txk4NgyROg==","shasum":"1c4d3bf3f6bea490a97df34cbb148c113a079455","tarball":"https://registry.npmjs.org/@benjie/persistgraphql-webpack-plugin/-/persistgraphql-webpack-plugin-0.3.3-alpha.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvf0ZK+w7xy0VcO8xtAwWkvJRALWrNtxBvZPSJFnslTAIhAJ5jhs3dGkOj3pEzqPBdoaI6PD8uV1Xen23ApozwzbJD"}]},"maintainers":[{"name":"benjie","email":"npm@benjiegillam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/persistgraphql-webpack-plugin-0.3.3-alpha.1.tgz_1501500549087_0.7576848152093589"}},"0.3.3-alpha.2":{"name":"@benjie/persistgraphql-webpack-plugin","version":"0.3.3-alpha.2","description":"PersistGraphQL Webpack Plugin","main":"index.js","scripts":{"lint":"eslint --fix .","posttest":"npm run lint","test":"NODE_ENV=coverage nyc --check-coverage --lines 96 --branches 70 npm run tests","tests":"mocha","tests:watch":"DEBUG=webpack-virtual-modules mocha -w"},"repository":{"type":"git","url":"git+https://github.com/sysgears/persistgraphql-webpack-plugin.git"},"keywords":["webpack-plugin","graphql","apollo-client"],"author":{"name":"SysGears INC"},"license":"MIT","bugs":{"url":"https://github.com/sysgears/persistgraphql-webpack-plugin/issues"},"homepage":"https://github.com/sysgears/persistgraphql-webpack-plugin#readme","devDependencies":{"chai":"^4.0.0","eslint":"^4.1.0","memory-fs":"^0.4.1","mocha":"^3.2.0","nyc":"^11.0.2","webpack":"^3.1.0"},"dependencies":{"@benjie/persistgraphql":"^0.3.2-alpha.1","webpack-virtual-modules":"^0.1.7"},"files":["*.js"],"greenkeeper":{},"gitHead":"a41e03c33eeb0e8534dc9c640d7272b4bb29a4cc","_id":"@benjie/persistgraphql-webpack-plugin@0.3.3-alpha.2","_npmVersion":"5.2.0","_nodeVersion":"8.1.2","_npmUser":{"name":"benjie","email":"npm@benjiegillam.com"},"dist":{"integrity":"sha512-cwZD7dogB5C3HrNZiEPu1v7mmIyMMyhoJdm66DMehWQuH1zpxTVHYYMgMI3+I99/JZwLR72VQd9eZL0/krTkaQ==","shasum":"57d3e4ff36480e645c4ef01ad63eb8b3e8204d07","tarball":"https://registry.npmjs.org/@benjie/persistgraphql-webpack-plugin/-/persistgraphql-webpack-plugin-0.3.3-alpha.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWWPDvYG2cwF1nDpShRfg1v2+xAILfmlJw8yCJObPq/AiAfjjxc5Y46q8fvca5Zv4SbE7fi/eMSB/XKufJiVBaN1A=="}]},"maintainers":[{"name":"benjie","email":"npm@benjiegillam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/persistgraphql-webpack-plugin-0.3.3-alpha.2.tgz_1501501557550_0.4157254104502499"}},"0.4.0-alpha.1":{"name":"@benjie/persistgraphql-webpack-plugin","version":"0.4.0-alpha.1","description":"PersistGraphQL Webpack Plugin","main":"index.js","scripts":{"lint":"eslint --fix .","posttest":"npm run lint","test":"NODE_ENV=coverage nyc --check-coverage --lines 96 --branches 70 npm run tests","tests":"mocha","tests:watch":"DEBUG=webpack-virtual-modules mocha -w"},"repository":{"type":"git","url":"git+https://github.com/sysgears/persistgraphql-webpack-plugin.git"},"keywords":["webpack-plugin","graphql","apollo-client"],"author":{"name":"SysGears INC"},"license":"MIT","bugs":{"url":"https://github.com/sysgears/persistgraphql-webpack-plugin/issues"},"homepage":"https://github.com/sysgears/persistgraphql-webpack-plugin#readme","devDependencies":{"chai":"^4.0.0","eslint":"^4.1.0","memory-fs":"^0.4.1","mocha":"^3.2.0","nyc":"^11.0.2","webpack":"^3.1.0"},"dependencies":{"@benjie/persistgraphql":"^0.3.2-alpha.1","webpack-virtual-modules":"^0.1.7"},"files":["*.js"],"greenkeeper":{},"gitHead":"43de06bb64ca066219a709bbf9b28f0dc9678d22","_id":"@benjie/persistgraphql-webpack-plugin@0.4.0-alpha.1","_npmVersion":"5.2.0","_nodeVersion":"8.1.2","_npmUser":{"name":"benjie","email":"npm@benjiegillam.com"},"dist":{"integrity":"sha512-xVjlP5mSX+fZBBtnLt7VUSOIF+4Oxebf8aOWF0jqrUvXg9lFch81XQMTU0CUmU8BHGd6xc/iTpSPxKHEEoI4eg==","shasum":"d9b86579c21824961966407389bef5f911f40cb0","tarball":"https://registry.npmjs.org/@benjie/persistgraphql-webpack-plugin/-/persistgraphql-webpack-plugin-0.4.0-alpha.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEWtfOWIuRKaKtTReKXx9UhiVJuW6eXTaUbWUce3LLPaAiAUjHcM7A9xJOnFrL1AypIqSRLIuMuLuDfXK313Y+rwxA=="}]},"maintainers":[{"name":"benjie","email":"npm@benjiegillam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/persistgraphql-webpack-plugin-0.4.0-alpha.1.tgz_1501507493436_0.6590829405467957"}},"0.4.0-alpha.2":{"name":"@benjie/persistgraphql-webpack-plugin","version":"0.4.0-alpha.2","description":"PersistGraphQL Webpack Plugin","main":"index.js","scripts":{"lint":"eslint --fix .","posttest":"npm run lint","test":"NODE_ENV=coverage nyc --check-coverage --lines 96 --branches 70 npm run tests","tests":"mocha","tests:watch":"DEBUG=webpack-virtual-modules mocha -w"},"repository":{"type":"git","url":"git+https://github.com/sysgears/persistgraphql-webpack-plugin.git"},"keywords":["webpack-plugin","graphql","apollo-client"],"author":{"name":"SysGears INC"},"license":"MIT","bugs":{"url":"https://github.com/sysgears/persistgraphql-webpack-plugin/issues"},"homepage":"https://github.com/sysgears/persistgraphql-webpack-plugin#readme","devDependencies":{"chai":"^4.0.0","eslint":"^4.1.0","memory-fs":"^0.4.1","mocha":"^3.2.0","nyc":"^11.0.2","webpack":"^3.1.0"},"dependencies":{"@benjie/persistgraphql":"^0.3.2-alpha.1","webpack-virtual-modules":"^0.1.7"},"files":["*.js"],"greenkeeper":{},"gitHead":"d7667e5ea8672d3646d08a3647bddea7d31226e0","_id":"@benjie/persistgraphql-webpack-plugin@0.4.0-alpha.2","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"benjie","email":"npm@benjiegillam.com"},"dist":{"integrity":"sha512-rao+3KrFYkLJB4Nihrb5UP3MBp2ljMUvIx6AbcIVryKkiae11/mDDdOe3N+g+Ot8S3QSNQUB8EqxrndhKLLbLg==","shasum":"6c030f6e4dd6f3cc975ca424535572349b6e3a44","tarball":"https://registry.npmjs.org/@benjie/persistgraphql-webpack-plugin/-/persistgraphql-webpack-plugin-0.4.0-alpha.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQfKWhX4rofmLWD+IwRyom+trWh9q0K7Bpr7f8NamMeQIgO/n4F+6o4nc2jUWo93uooKi63QsAKythTL90+zdSJYM="}]},"maintainers":[{"name":"benjie","email":"npm@benjiegillam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/persistgraphql-webpack-plugin-0.4.0-alpha.2.tgz_1516464434668_0.6945078847929835"}},"0.4.0-alpha.3":{"name":"@benjie/persistgraphql-webpack-plugin","version":"0.4.0-alpha.3","description":"PersistGraphQL Webpack Plugin","main":"index.js","scripts":{"lint":"eslint --fix .","posttest":"npm run lint","test":"NODE_ENV=coverage nyc --check-coverage --lines 96 --branches 70 npm run tests","tests":"mocha","tests:watch":"DEBUG=webpack-virtual-modules mocha -w"},"repository":{"type":"git","url":"git+https://github.com/sysgears/persistgraphql-webpack-plugin.git"},"keywords":["webpack-plugin","graphql","apollo-client"],"author":{"name":"SysGears INC"},"license":"MIT","bugs":{"url":"https://github.com/sysgears/persistgraphql-webpack-plugin/issues"},"homepage":"https://github.com/sysgears/persistgraphql-webpack-plugin#readme","devDependencies":{"chai":"^4.0.0","eslint":"^4.1.0","memory-fs":"^0.4.1","mocha":"^3.2.0","nyc":"^11.0.2","webpack":"^3.1.0"},"dependencies":{"@benjie/persistgraphql":"^0.3.2-alpha.1","webpack-virtual-modules":"^0.1.7"},"files":["*.js"],"greenkeeper":{},"gitHead":"c69b91c2e81c6e3df60bb70807872057bc03c5ee","_id":"@benjie/persistgraphql-webpack-plugin@0.4.0-alpha.3","_npmVersion":"5.4.2","_nodeVersion":"8.8.1","_npmUser":{"name":"benjie","email":"npm@benjiegillam.com"},"dist":{"integrity":"sha512-5ZMRYtt4V2eFQdH7PIIBV9UEc4D32M66ES4sd9JhcphOCvYE+wewI2ezBkS6XkiG48D3jYmIsSC+HY0RRyKVxA==","shasum":"65b62522dc8147d3f0a289fc568a6d5a0ed40915","tarball":"https://registry.npmjs.org/@benjie/persistgraphql-webpack-plugin/-/persistgraphql-webpack-plugin-0.4.0-alpha.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQIW8E7wu24qpc3wIM/1vw4ZNTj2edDLa7FBETRVqQzAIhAOjFHGLve3A6VxbWnG6MskRHOR9Quq5OYruEF3WdMGDn"}]},"maintainers":[{"name":"benjie","email":"npm@benjiegillam.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/persistgraphql-webpack-plugin-0.4.0-alpha.3.tgz_1516467458753_0.9723302323836833"}}},"readme":"# PersistGraphQL Webpack Plugin\n\n[![Build Status](https://travis-ci.org/sysgears/persistgraphql-webpack-plugin.svg?branch=master)](https://travis-ci.org/sysgears/persistgraphql-webpack-plugin)\n[![Greenkeeper badge](https://badges.greenkeeper.io/sysgears/persistgraphql-webpack-plugin.svg)](https://greenkeeper.io/) [![Twitter Follow](https://img.shields.io/twitter/follow/sysgears.svg?style=social)](https://twitter.com/sysgears)\n\nWebpack Plugin for working with Persisted GraphQL Queries with Hot Code Replacement support.\n\n## Installation\n\n```bash\nnpm install --save-dev persistgraphql-webpack-plugin\n```\n\n## Usage with Webpack 2\n\n### When Webpack is used for front-end only\n\nSample Webpack config:\n\n```js\nvar PersistGraphQLPlugin = require('persistgraphql-webpack-plugin');\n\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.jsx?$/,\n        // ...\n        use: [\n          'babel-loader', \n          // Should come AFTER babel-loader\n          'persistgraphql-webpack-plugin/js-loader'\n        ]\n      },\n      {\n        test: /\\.(graphql|gql)$/,\n        use: [\n          'graphql-tag/loader', \n          // Should come AFTER graphql-tag/loader\n          'persistgraphql-webpack-plugin/graphql-loader'\n        ]\n      },\n    ]\n  }\n  \n  plugins: [\n    new PersistGraphQLPlugin({filename: 'persisted_queries.json', \n        moduleName: path.resolve('node_modules/persisted_queries.json')})\n  ]\n};\n```\n\nIn the source code of front-end persisted GraphQL queries will be injected \nas a virtual module `persisted_queries.json`. This module will be updated\nif queries added or changed. Also asset with name `persisted_queries.json` will be generated \nduring compilation and written to output directory.\n\n```js\nvar queryMap = require('persisted_queries.json');\nconsole.log(queryMap);\n```\n\n### When Webpack is used both for back-end and front-end\n\n```js\nvar PersistGraphQLPlugin = require('persistgraphql-webpack-plugin');\n\nconst moduleName = path.resolve('node_modules/persisted_queries.json');\nconst frontendPersistPlugin = new PersistGraphQLPlugin({ moduleName });\nconst backendPersistPlugin = \n    new PersistGraphQLPlugin({ provider: clientPersistPlugin, moduleName });\n\nvar frontendWebpackConfig = {\n  module: {\n    rules: [\n      {\n        test: /\\.jsx?$/,\n        // ...\n        use: [\n          'babel-loader', \n          // Should come AFTER babel\n          'persistgraphql-webpack-plugin/js-loader'\n        ]\n      },\n      {\n        test: /\\.(graphql|gql)$/,\n        use: [\n          'graphql-tag/loader', \n          // Should come AFTER graphql-tag/loader\n          'persistgraphql-webpack-plugin/graphql-loader'\n        ]\n      },\n    ]\n  }\n  \n  plugins: [\n    frontendPersistPlugin\n  ]\n};\n\nvar backendWebpackConfig = {\n  // ...\n  plugins: [\n    backendPersistPlugin\n  ]\n}\n```\n\nBoth in the source code of front-end and back-end persisted GraphQL queries will be injected \nas a virtual module `node_modules/persisted_queries.json`. This module will be updated if queries added or changed.\n\n```js\nvar queryMap = require('persisted_queries.json');\nconsole.log(queryMap);\n```\n\n## Usage with Webpack 1\n\n### When Webpack is used for front-end only\n\nSample Webpack config:\n\n```js\nvar PersistGraphQLPlugin = require('persistgraphql-webpack-plugin');\n\nmodule.exports = {\n  module: {\n    loaders: [\n      {\n        test: /\\.jsx?$/,\n        loaders: [\n          'babel?' + JSON.stringify(\n            {\n              cacheDirectory: __DEV__,\n              presets: ['es2015', 'es2017', 'react'],\n              plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties']\n            }\n          ),\n          // Should come AFTER babel-loader\n          'persistgraphql-webpack-plugin/js-loader'\n        ],\n        exclude: /(node_modules|bower_components)/\n      },\n      {\n        test: /\\.(graphql|gql)$/,\n        exclude: /node_modules/,\n        loaders: [\n          'graphql-tag/loader',\n          // Should come AFTER graphql-tag/loader\n          'persistgraphql-webpack-plugin/graphql-loader'\n        ]\n      },\n    ]\n  }\n  \n  plugins: [\n    new PersistGraphQLPlugin({filename: 'persisted_queries.json', \n        moduleName: path.resolve('node_modules/persisted_queries.json')})\n  ]\n};\n```\n\nIn the source code of front-end persisted GraphQL queries will be injected \nas a virtual module `persisted_queries.json`. This module will be updated\nif queries added or changed. Also asset with name `persisted_queries.json` will be generated \nduring compilation and written to output directory.\n\n```js\nvar queryMap = require('persisted_queries.json');\nconsole.log(queryMap);\n```\n\n### When Webpack is used both for back-end and front-end\n\n```js\nvar PersistGraphQLPlugin = require('persistgraphql-webpack-plugin');\n\nconst moduleName = path.resolve('node_modules/persisted_queries.json');\nconst frontendPersistPlugin = new PersistGraphQLPlugin({ moduleName });\nconst backendPersistPlugin = \n    new PersistGraphQLPlugin({ provider: clientPersistPlugin, moduleName });\n\nvar frontendWebpackConfig = {\n  module: {\n    loaders: [\n      {\n        test: /\\.jsx?$/,\n        loaders: [\n          'babel?' + JSON.stringify(\n            {\n              cacheDirectory: __DEV__,\n              presets: ['es2015', 'es2017', 'react'],\n              plugins: ['transform-runtime', 'transform-decorators-legacy', 'transform-class-properties']\n            }\n          ),\n          // Should come AFTER babel-loader\n          'persistgraphql-webpack-plugin/js-loader'\n        ],\n        exclude: /(node_modules|bower_components)/\n      },\n      {\n        test: /\\.(graphql|gql)$/,\n        exclude: /node_modules/,\n        loaders: [\n          'graphql-tag/loader',\n          // Should come AFTER graphql-tag/loader\n          'persistgraphql-webpack-plugin/graphql-loader'\n        ]\n      },\n    ]\n  }\n  \n  plugins: [\n    frontendPersistPlugin\n  ]\n};\n\nvar backendWebpackConfig = {\n  // ...\n  plugins: [\n    backendPersistPlugin\n  ]\n}\n```\n\nBoth in the source code of front-end and back-end persisted GraphQL queries will be injected \nas a virtual module `node_modules/persisted_queries.json`. This module will be updated if queries added or changed.\n\n```js\nvar queryMap = require('persisted_queries.json');\nconsole.log(queryMap);\n```\n\n## Options\n\n```js\nnew PersistGraphQLPlugin(options: object)\n```\n\n|Name|Type|Description|\n|:--:|:--:|:----------|\n|**`moduleName`**|`{String}`|Name of virtual wepback module with persisted GraphQL queries, this option is **required**|\n|**`filename`**|`{String}`|Name of the ouput file with persisted GraphQL queries|\n|**`addTypename`**|`{Boolean}`|Apply a query transformation to the query documents, adding the __typename field at every level of the query. You must pass this option if your client code uses this query transformation.|\n|**`provider`**|`{Object}`|Instance of plugin running on another webpack instance which will provide persisted GraphQL queries|\n\n## License\nCopyright © 2017 [SysGears INC]. This source code is licensed under the [MIT] license.\n\n[MIT]: LICENSE\n[SysGears INC]: http://sysgears.com\n","maintainers":[{"name":"benjie","email":"npm@benjiegillam.com"}],"time":{"modified":"2022-04-04T18:22:58.830Z","created":"2017-07-31T11:29:10.113Z","0.3.3-alpha.1":"2017-07-31T11:29:10.113Z","0.3.3-alpha.2":"2017-07-31T11:45:58.586Z","0.4.0-alpha.1":"2017-07-31T13:24:54.452Z","0.4.0-alpha.2":"2018-01-20T16:07:15.689Z","0.4.0-alpha.3":"2018-01-20T16:57:38.835Z"},"homepage":"https://github.com/sysgears/persistgraphql-webpack-plugin#readme","keywords":["webpack-plugin","graphql","apollo-client"],"repository":{"type":"git","url":"git+https://github.com/sysgears/persistgraphql-webpack-plugin.git"},"author":{"name":"SysGears INC"},"bugs":{"url":"https://github.com/sysgears/persistgraphql-webpack-plugin/issues"},"license":"MIT","readmeFilename":"README.md"}