{"id":22683819,"url":"https://github.com/icebreaker-trash/simple-lodash-template-loader","last_synced_at":"2025-04-12T18:30:54.754Z","repository":{"id":41380622,"uuid":"445379483","full_name":"icebreaker-trash/simple-lodash-template-loader","owner":"icebreaker-trash","description":"Support Webpack both 4 and 5 , A loader for webpack that allows importing files as a lodash template.","archived":false,"fork":false,"pushed_at":"2023-12-15T05:25:21.000Z","size":21,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-15T17:31:36.846Z","etag":null,"topics":["loader","lodash","template","webpack","webpack-loader"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icebreaker-trash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-07T02:55:47.000Z","updated_at":"2024-05-11T05:46:47.000Z","dependencies_parsed_at":"2023-12-15T06:43:32.029Z","dependency_job_id":null,"html_url":"https://github.com/icebreaker-trash/simple-lodash-template-loader","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"13f63ca0b7a0b6a6413173030a4c4a28f8a881a5"},"previous_names":["icebreaker-trash/simple-lodash-template-loader","sonofmagic/simple-lodash-template-loader"],"tags_count":0,"template":false,"template_full_name":"sonofmagic/npm-lib-rollup-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icebreaker-trash%2Fsimple-lodash-template-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icebreaker-trash%2Fsimple-lodash-template-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icebreaker-trash%2Fsimple-lodash-template-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icebreaker-trash%2Fsimple-lodash-template-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icebreaker-trash","download_url":"https://codeload.github.com/icebreaker-trash/simple-lodash-template-loader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248613219,"owners_count":21133467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["loader","lodash","template","webpack","webpack-loader"],"created_at":"2024-12-09T21:14:09.264Z","updated_at":"2025-04-12T18:30:54.725Z","avatar_url":"https://github.com/icebreaker-trash.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-lodash-template-loader\n\nSupport Webpack both `4` and `5` , A loader for webpack that allows importing files as a [`lodash template`](https://lodash.com/docs/4.17.15#template).\n\n## Features\n\n- Support `Webpack` 4 and 5.\n\n## Getting Started\n\nTo begin, you'll need to install `simple-lodash-template-loader`:\n\n```bash\nnpm install simple-lodash-template-loader --save-dev\n# or\nyarn add -D simple-lodash-template-loader\n```\n\nThen add the loader to your `webpack` config. For example:\n\n**file.js**\n\n```js\nimport compiled from './file.t.html'\n```\n\n**webpack.config.js**\n\n```js\n// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.t\\.html$/i,\n        use: 'simple-lodash-template-loader'\n      }\n    ]\n  }\n}\n```\n\n## Options\n\n|            Name             |    Type     |                                      Default                                       | Description                                                                                                                                  |\n| :-------------------------: | :---------: | :--------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------- |\n|        **`escape`**         | `{RegExp}`  |                            `_.templateSettings.escape`                             | The HTML \"escape\" delimiter.                                                                                                                 |\n|       **`evaluate`**        | `{RegExp}`  |                           `_.templateSettings.evaluate`                            | The \"evaluate\" delimiter.                                                                                                                    |\n|        **`imports`**        | `{Object}`  |                            `_.templateSettings.imports`                            | An object to import into the template as free variables.                                                                                     |\n|      **`interpolate`**      | `{RegExp}`  |                          `_.templateSettings.interpolate`                          | The \"interpolate\" delimiter.                                                                                                                 |\n|       **`sourceURL`**       | `{string}`  |                           `'lodash.templateSources[n]'`                            | The sourceURL of the compiled template.                                                                                                      |\n|       **`variable`**        | `{string}`  |                                      `'obj'`                                       | The data object variable name.                                                                                                               |\n|       **`callback`**        | `{Fuction}` | `(this: webpack.LoaderContext\u003cLoaderOptions\u003e,contents: string) =\u003e TemplateOptions` | callback function allow you customize your templateSettings for each lodash templete file, the return options will be merged to root options |\n| **[`esModule`](#esmodule)** | `{Boolean}` |                                      `false`                                       | Uses ES modules syntax                                                                                                                       |\n\n## Tips\n\nTo support the 'esModule' option, the 'variable' option must be passed to avoid 'with' statements\nin the compiled template to be strict mode compatible.   \nPlease see https://github.com/lodash/lodash/issues/3709#issuecomment-375898111.  \nTo enable CommonJS, please set the 'esModule' option to false (default false).\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficebreaker-trash%2Fsimple-lodash-template-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficebreaker-trash%2Fsimple-lodash-template-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficebreaker-trash%2Fsimple-lodash-template-loader/lists"}