webpack loader to minify GraphQL queries and mutations
npm install minify-graphql-loaderwebpack loader to minify GraphQL queries, mutations and fragments, reducing your bundle's size
In this example, we decrease ~17,5% query's size
- npm:
```
npm install --save-dev minify-graphql-loader
- yarn:
``
yarn add --dev minify-graphql-loader
It must to be used in chain with a GraphQL loader:
`javascript`
// webpack.config.js
module.export = {
// ...your config
module: {
rules: [
// ...your rules
{
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
use: [
"graphql-tag/loader",
"minify-graphql-loader"
// it must to be the last item
]
}
]
}
};
1. Leave a star :star:
2. Share :handshake:
1. Fork it!
2. Create your feature branch: git checkout -b my-new-featuregit commit -m 'Add some feature'
3. Commit your changes: (follow this guide: Karma's Git Commit Msg)git push origin my-new-feature`
4. Push to the branch:
5. Submit a pull request :D
MIT © Gabriel Prates