Skip to content

webpack loader to minify GraphQL queries, mutations and fragments

License

Notifications You must be signed in to change notification settings

gabsprates/minify-graphql-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

webpack loader to minify GraphQL queries, mutations and fragments

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •