data-json-optimizer
A small utility to merge all data.json files from the webpack application
DataJsonOptimizer is a small utility to merge all data.json files from the webpack application and create following final data json file.
- game-data.json => It has all keys in hyphenated.
- game-data-in-camel-case.json => It has all keys in camelcase to access in js.
Why this?
Application has too many data.json files which is carrying the all game properties and keys are in hyphenated. In implementation, we are using camelcase keys. For this, if we start converting the all keys on the fly on client side then it slows down the whole application. So we are creating the final json files on application compile/build time only.
Installation
npm install -D data-json-optimizer
Usage
const OpenerForWebpack = ; moduleexports = entry: "./app.js" output: plugins: /game-data.*\.json$/ ;
Usage with webpack-multi-configurator plugin with angularity
var webpack = ;var angularity = ;var dataJsonOptimizer = ; const PORT = '3000'; moduleexports = ; { return configurator ;}
Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.