support dimension file as second argument, fix bug with json5 extension