小编gia*_*lbi的帖子

在一个js文件中预编译所有车把模板文件时出错

这是我的文件夹结构:

app
????templates
    ????templ1.hbs
    ????templ2.hbs
    ????templ3.hbs
Run Code Online (Sandbox Code Playgroud)

我想在一个templ.js文件中编译(预编译)所有templN.hbs把手模板文件,但当我尝试通过控制台进行

$ handlebars *.hbs -f templ.js
Run Code Online (Sandbox Code Playgroud)

编译因此错误而失败

(...)\AppData\Roaming\npm\node_modules\handlebars\bin\handlebars:120
    throw err;
    ^
 Error: Unable to open template file "*.hbs"
    at (...)\AppData\Roaming\npm\node_modules\handlebars\dist\cjs\precompiler.js:107:25
    at FSReqWrap.oncomplete (fs.js:82:15)
Run Code Online (Sandbox Code Playgroud)

怎么了?

javascript template-engine npm handlebars.js

4
推荐指数
1
解决办法
1175
查看次数

标签 统计

handlebars.js ×1

javascript ×1

npm ×1

template-engine ×1