webpack 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:
// 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
]
}
]
}
};
- Leave a star ⭐
- Share 🤝
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
(follow this guide: Karma's Git Commit Msg) - Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT © Gabriel Prates