A loader for webpack to load JSON with performance advice.
The cost of parsing JSON
As long as the JSON string is only evaluated once, the
To begin, you'll need to install
$ npm install json-perf-loader --save-dev
json-perf-loader works like
json-loader, but much faster.
import json from './file.json'
webpack via your preferred method.
Rule.typesets the type for a matching module. This prevents defaultRules and their default importing behaviors from occurring. For example, if you want to load a
.jsonfile through a custom loader, you'd need to set the
1024 * 10
The limit can be specified via loader options and defaults to
1024 * 10. This is the recommended value for the V8 team.
Number specifying the maximum size of a file in bytes. If the file size is
equal or greater than the limit
JSON.parse will be used.