mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-24 20:53:08 +00:00
19 lines
487 B
JavaScript
19 lines
487 B
JavaScript
const request = require('request-promise');
|
|
|
|
const errorCodesUrl = 'http://raw.githubusercontent.com/facebook/react/master/scripts/error-codes/codes.json';
|
|
|
|
exports.sourceNodes = async ({ boundActionCreators }) => {
|
|
const { createNode } = boundActionCreators;
|
|
|
|
const jsonString = await request(errorCodesUrl);
|
|
|
|
createNode({
|
|
id: 'error-codes',
|
|
children: [],
|
|
parent: 'ERRORS',
|
|
internal: {
|
|
type: 'ErrorCodesJson',
|
|
contentDigest: jsonString,
|
|
},
|
|
});
|
|
}; |