Menu

#16 Add options handling to hmpl-loader

open
nobody
2024-10-14
2024-10-08
Anonymous
No

Originally created by: antonmak1

It is necessary to add options handling for loader. What should be done:

module.exports = {
  module: {
    rules: [
      {
        test: /\.hmpl$/i,
        use: [{ loader: "hmpl-loader", options: { memo: true } }],
      },
    ],
  },
};

Also, needs to add a description of the options to the README.

In index.js you need to do it like this:

result.push(`const template = hmpl.compile(${template}, ${options});\n`);

docs for options - https://hmpl-lang.github.io/hmpl.html#options

related issue - https://github.com/hmpl-lang/hmpl-loader/issues/1

Please take it if you have experience with node.js and webpack!

links:
repo - https://github.com/hmpl-lang/hmpl-loader
file - https://github.com/hmpl-lang/hmpl-loader/blob/master/index.js
readme - https://github.com/hmpl-lang/hmpl-loader/blob/master/README.md

Discussion

  • Anonymous

    Anonymous - 2024-10-09
     
  • Anonymous

    Anonymous - 2024-10-09

    Ticket changed by: antonmak1

    • status: open --> closed
     
  • Anonymous

    Anonymous - 2024-10-11

    Ticket changed by: antonmak1

    • status: closed --> open
     

Log in to post a comment.