Error precompiling all descriptor template files in a single js file

Here is my folder structure:

app
└───templates
    ├───templ1.hbs
    ├───templ2.hbs
    └───templ3.hbs

I want to compile (precompile) all templN.hbs template files in one templ.js file, but when I try to do this using the console

$ handlebars *.hbs -f templ.js

compilation failed with this error

(...)\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)

What's the matter?

+4
source share
1 answer

After a bit of practice with Handlebars and its precompiler, I found out that the solution was as simple as stupid, my question was.

, , app. , .hbs, ./handlebars , :

$ handlebars ./templates -f templ.js --extension "hbs"

.

. http://handlebarsjs.com/precompilation.html

+6

All Articles