JsonMinimizerWebpackPlugin

npm node deps tests cover chat size

json minimizer plugin for Webpack

Getting Started

To begin, you'll need to install json-minimizer-webpack-plugin:

$ npm install json-minimizer-webpack-plugin --save-dev

Then add the loader to your webpack config. For example:

Then add the plugin to your webpack config. For example:

file.ext

import file from 'file.ext';

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        test: /.ext$/,
        use: [
          {
            loader: `jsonminimizer-loader`,
            options: { ...options },
          },
        ],
      },
    ],
  },
};

webpack.config.js

module.exports = {
  plugins: [new JsonMinimizerPlugin(options)],
};

And run webpack via your preferred method.

Options

[option]

Type: [type|other-type] Default: [type|null]

[ option description ]

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        loader: `jsonminimizer-loader`,
        options: {
          [option]: https://github.com/webpack-contrib/json-minimizer-webpack-plugin/blob/master/%27%27,
        },
      },
    ],
  },
};

webpack.config.js

module.exports = {
  plugins: [
    new JsonMinimizerPlugin({
      [option]: https://github.com/webpack-contrib/json-minimizer-webpack-plugin/blob/master/%27%27,
    }),
  ],
};

Examples

[ example outline text ]

webpack.config.js

// Example setup here..

file.ext

// Source code here...

bundle.js

// Bundle code here...

Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.

CONTRIBUTING

License

MIT