Q
Q
quiplunar2020-07-16 00:24:38
JavaScript
quiplunar, 2020-07-16 00:24:38

Handlebars webpack search in subdirectories?

Such a file architecture:

-src
--components
----button
------button.hbs|scss|ts
--pages
----index.hbs Registered the

search for modules in webpack:

{
  test: /\.(hbs)$/,
  use: [
    {
      loader: 'handlebars-loader',
      options: {
        precompileOptions: {
          noEscape: true
        },
        partialDirs: [
          path.join(__dirname, '../src/components')
        ]
      }
    }
  ]
}


partialDirs - Lets you search for modules in the right directories, but what if those directories have sub directories? How to tell to search in the entire nesting?

And now it's like this:

{{#>list-select/list-select}}
  {{>select/select title="Adalya" price="1000р*" img="tobacco-1.png"}}
  {{>select/select title="Serbetli" price="1000р*" img="tobacco-2.png"}}
  {{>select/select title="Sebero" price="1000р*" img="tobacco-3.png"}}
  {{>select/select title="Dayli Hookah" price="1000р*" img="tobacco-4.png"}}
  {{>select/select title="Darkside" price="1000р*" img="tobacco-5.png"}}
{{/list-select/list-select}}


As a result, I duplicate the same thing, how to fix it?))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question