Skip to content

Allow jsonext to be defined in adapt.json #3692

@oliverfoster

Description

@oliverfoster

Subject of the issue

jsonext must currently be specified as grunt dev --jsonext=txt

`--jsonext` Specifies the file extension your JSON files use. Defaults to *json*. If the server your content is hosted on doesn't support the JSON mime-type you can use *txt* here to use the .txt file extension instead. You will need to manually amend the extension of all your JSON files to .txt initially.

It would be good to be able to add it to adapt.json as:

{
  "jsonext": "txt"
}

As with some of the other properties:

const exports = {
defaults: {
sourcedir: 'src/',
outputdir: 'build/',
coursedir: 'course',
configdir: null,
cachepath: null,
jsonext: 'json',
theme: '**',
menu: '**',
languages: '**',
includes: [
],
pluginTypes: [
'components',
'extensions',
'menu',
'theme'
],
scriptSafe: [
'adapt-contrib-xapi',
'adapt-contrib-spoor'
]
},

const root = rootDir;
const adaptJSON = fs.readJSONSync(`${root}/adapt.json`);
const sourcedir = appendSlash(grunt.option('sourcedir')) || defaults.sourcedir;
const outputdir = appendSlash(grunt.option('outputdir')) || defaults.outputdir;
const cachepath = grunt.option('cachepath') || null;
const tempdir = outputdir + '.temp/';
const jsonext = grunt.option('jsonext') || defaults.jsonext;
const coursedir = grunt.option('coursedir') || adaptJSON.coursedir || defaults.coursedir;

Metadata

Metadata

Assignees

Projects

Status

New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions