feat: support mjs.json js compile & add API

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2022-04-01 18:47:28 +08:00
parent 91a87ab20e
commit a9003025ee
9 changed files with 124 additions and 17 deletions

View File

@ -241,7 +241,7 @@
}
cacheModules[id] = module
var cfile = _canonical(file)
if (cfile.endsWith('.js')) {
if (cfile.endsWith('.js') || cfile.endsWith('.mjs.json')) {
compileJs(module, file, __assign(optional, { id: id }))
} else if (cfile.endsWith('.json')) {
compileJson(module, file)