I have a myjson.json that looks like this
{
"main.css": "main-4zgjrhtr.css",
"main.js": "main-76gfhdgsj.js"
"normalkey" : "somevalue"
}
The usecase is that I map revision builds to an original filename. Now I want to access the key in javascript. If I do this:
var myjson = require('./myjson.json')
require is so fancy that it sees the '.json' and parses the json for me into an object so
console.log(myjson.normalkey)
returns 'somevalue'. However
console.log(myjson.main.js)
must fail.
So my question is: How does require work with the dot in the keyname?