Skip to content

lib/server/js2html.js代码是否有误? #154

@kringt06

Description

@kringt06

rc-tools/lib/server/js2html.js

line - 16 ~ 18
if (fs.existsSync(path.join(cwd, 'examples/template.xtpl'))) { tplName = path.join(cwd, 'examples/template.xtpl'); }
当我想要自定义模板时,翻阅源码发现提供了这么一个方法。然后我在自己项目添加examples/template.xtpl文件后,报错:找不到文件 examples/template.xtpl.xtpl 。可见render时默认添加的后缀.xtpl。故这段代码是否存在问题,我认为应该改为:
if (fs.existsSync(path.join(cwd, 'examples/template.xtpl'))) { tplName = path.join(cwd, 'examples/template'); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions