gulpFIle (hbs):
gulp.task("hbs", () => {
return gulp.src("src/views/**/*.hbs")
.pipe(webpack({
mode: 'development',
module: {
rules: [
{
test: /\.hbs$/,
use: ["handlebars-loader"]
}
]
}
}))
.pipe(gulp.dest('dist/views'))
.pipe(browserSync.stream());
});
Создал папку views index.hbs, ... --> layouts main.hbs, ..., partials head.hbs, ...
main.hbs:
{{> head }}
<body>
{{> header }}
{{{ body }}}
{{> down }}
</body>
</html>
Ошибка:
[15:46:38] 'hbs' errored after 46 s
[1] [15:46:38] Error in plugin "webpack-stream"
[1] Message:
[1] ./src/views/layouts/empty.hbs
[1] Module build failed (from ./node_modules/handlebars-loader/index.js):
[1] Error: Partial './head' not found
[1] at tryExtension (/home/alexey/Рабочий стол/ryc-store/node_modules/handlebars-loader/index.js:291:27)
[1] at /home/alexey/Рабочий стол/ryc-store/node_modules/handlebars-loader/index.js:299:11
[1] at next (/home/alexey/Рабочий стол/ryc-store/node_modules/handlebars-loader/index.js:241:20)
[1] at /home/alexey/Рабочий стол/ryc-store/node_modules/handlebars-loader/index.js:257:20
[1] at doResolve (/home/alexey/Рабочий стол/ryc-store/node_modules/enhanced-resolve/lib/Resolver.js:213:14)
[1] at hook.callAsync (/home/alexey/Рабочий стол/ryc-store/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
[1] at _fn0 (eval at create (/home/alexey/Рабочий стол/ryc-store/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
[1] at resolver.doResolve (/home/alexey/Рабочий стол/ryc-store/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7)
[1] at hook.callAsync (/home/alexey/Рабочий стол/ryc-store/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
[1] at _fn0 (eval at create (/home/alexey/Рабочий стол/ryc-store/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
[1] @ multi ./src/views/index.hbs ./src/views/product.hbs ./src/views/sale.hbs ./src/views/layouts/empty.hbs ./src/views/layouts/main.hbs ./src/views/partials/down.hbs ./src/views/partials/head.hbs ./src/views/partials/header.hbs ./src/views/partials/preolaider.hbs ./src/views/partials/up.hbs main[3]
[1] ./src/views/layouts/main.hbs
[1] Module build failed (from ./node_modules/handlebars-loader/index.js):
[1] Error: Partial './head' not found
[1] at tryExtension (/home/alexey/Рабочий стол/ryc-store/node_modules/handlebars-loader/index.js:291:27)
[1] at /home/alexey/Рабочий стол/ryc-store/node_modules/handlebars-loader/index.js:299:11
[1] at next (/home/alexey/Рабочий стол/ryc-store/node_modules/handlebars-loader/index.js:241:20)
[1] at /home/alexey/Рабочий стол/ryc-store/node_modules/handlebars-loader/index.js:257:20
[1] at doResolve (/home/alexey/Рабочий стол/ryc-store/node_modules/enhanced-resolve/lib/Resolver.js:213:14)
[1] at hook.callAsync (/home/alexey/Рабочий стол/ryc-store/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
[1] at _fn0 (eval at create (/home/alexey/Рабочий стол/ryc-store/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
[1] at resolver.doResolve (/home/alexey/Рабочий стол/ryc-store/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7)
[1] at hook.callAsync (/home/alexey/Рабочий стол/ryc-store/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
[1] at _fn0 (eval at create (/home/alexey/Рабочий стол/ryc-store/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
[1] @ multi ./src/views/index.hbs ./src/views/product.hbs ./src/views/sale.hbs ./src/views/layouts/empty.hbs ./src/views/layouts/main.hbs ./src/views/partials/down.hbs ./src/views/partials/head.hbs ./src/views/partials/header.hbs ./src/views/partials/preolaider.hbs ./src/views/partials/up.hbs main[4]