{"id":15011788,"url":"https://github.com/clownvary/less-wrapper-loader","last_synced_at":"2026-03-13T20:32:25.652Z","repository":{"id":44012060,"uuid":"215068461","full_name":"clownvary/less-wrapper-loader","owner":"clownvary","description":"Generate a wrapped classname for less files automatically.","archived":false,"fork":false,"pushed_at":"2023-01-05T05:17:33.000Z","size":245,"stargazers_count":0,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T16:10:27.962Z","etag":null,"topics":["less","less-loader","webpack","webpack-loader"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/clownvary.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}},"created_at":"2019-10-14T14:40:55.000Z","updated_at":"2020-01-19T15:03:56.000Z","dependencies_parsed_at":"2023-02-03T12:46:37.500Z","dependency_job_id":null,"html_url":"https://github.com/clownvary/less-wrapper-loader","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clownvary%2Fless-wrapper-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clownvary%2Fless-wrapper-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clownvary%2Fless-wrapper-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clownvary%2Fless-wrapper-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clownvary","download_url":"https://codeload.github.com/clownvary/less-wrapper-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243307333,"owners_count":20270256,"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":["less","less-loader","webpack","webpack-loader"],"created_at":"2024-09-24T19:41:42.551Z","updated_at":"2025-12-24T20:51:02.763Z","avatar_url":"https://github.com/clownvary.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/webpack/webpack\"\u003e\n    \u003cimg width=\"200\" height=\"200\"\n      src=\"https://webpack.js.org/assets/icon-square-big.svg\"\u003e\n  \u003c/a\u003e\n  \u003ch1\u003eless-wrapper-loader\u003c/h1\u003e\n\u003c/div\u003e\n\n[![npm](https://img.shields.io/npm/v/less-wrapper-loader.svg)](https://www.npmjs.com/package/less-wrapper-loader)\n[![Build Status](https://travis-ci.com/clownvary/less-wrapper-loader.svg?branch=master)](https://travis-ci.com/clownvary/wrap-less-loader)\n[![codecov](https://codecov.io/gh/clownvary/less-wrapper-loader/branch/master/graph/badge.svg)](https://codecov.io/gh/clownvary/less-wrapper-loader)\n\nGenerate a wrapped classname for less files automatically. It's a easy way to resolve style conflicts.\n\n## example\n\nBefore :\n```css\n.name {\n  color: red\n}\n\n.age {\n  color: blue;\n}\n```\n\nAfter :\n```css\n.wrapper .name {\n  color: red\n}\n\n.wrapper .age {\n  color: blue;\n}\n```\n\n## Getting Started\n\nTo begin, you'll need to install `less-wrapper-loader`:\n\n```console\nnpm install --save-dev less-wrapper-loader\n```\n\n1. add loader in webpack.config.js\n\n```javascript\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.less$/,\n        use: [\n        ...\n        'less-loader',\n        {\n          // must be placed before less-loader\n          loader: 'less-wrapper-loader',\n          options: {\n            nameSpace: 'wrapper'\n          }\n        }\n      ]\n      },\n    ],\n  },\n};\n```\n\n2. add a classname **samed with your less-wrapper-loader namespace** in root container component\n\n```javascript\nrender() {\n    return (\n      \u003cdiv className=\"wrapper\"\u003e\n        ...\n      \u003c/div\u003e\n}\n```\n\n3. run webpack, all less files you used will be wrapped a classname `wrapper` \n\n## Options\n\n| Name                | Type                    | Default   | Description                                                                                                                                                          |\n|:-------------------:|:-----------------------:|:---------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **`nameSpace`**     | `{string}` or `{regex}` | `/less/g` | **string:** value will as a namespace wrapped in less file\u003cbr/\u003e**regex**: value will test less file path and return matched result as namespace wrapped in less file |\n| **`whitePathList`** | `{array[string]}`       | `[]`      | just wrap less  file which it's path contains one of the white list value\u003cbr/\u003e \u003cbr/\u003edefault value will wrap all less files                                                 |\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclownvary%2Fless-wrapper-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclownvary%2Fless-wrapper-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclownvary%2Fless-wrapper-loader/lists"}