minify-graphql-loader

1.0.2 • Public • Published

minify-graphql-loader

Version Build Status npm downloads Bundle size License Node.js version

webpack loader to minify GraphQL queries, mutations and fragments, reducing your bundle's size

In this example, we decrease ~17,5% query's size

installing:

  • npm:
npm install --save-dev minify-graphql-loader
  • yarn:
yarn add --dev minify-graphql-loader

using

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
        ]
      }
    ]
  }
};

Contributing

good things comes in small packages 😊

  1. Leave a star
  2. Share 🤝

coding

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature' (follow this guide: Karma's Git Commit Msg)
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT © Gabriel Prates

Readme

Keywords

Package Sidebar

Install

npm i minify-graphql-loader

Weekly Downloads

3,107

Version

1.0.2

License

MIT

Unpacked Size

10.7 kB

Total Files

14

Last publish

Collaborators

  • gabsprates