{
  "manifest": {
    "name": "css-loader",
    "version": "6.11.0",
    "description": "css loader module for webpack",
    "license": "MIT",
    "repository": {
      "type": "git",
      "url": "https://github.com/webpack-contrib/css-loader.git"
    },
    "author": {
      "name": "Tobias Koppers @sokra"
    },
    "homepage": "https://github.com/webpack-contrib/css-loader",
    "bugs": {
      "url": "https://github.com/webpack-contrib/css-loader/issues"
    },
    "funding": {
      "type": "opencollective",
      "url": "https://opencollective.com/webpack"
    },
    "main": "dist/cjs.js",
    "engines": {
      "node": ">= 12.13.0"
    },
    "scripts": {
      "start": "npm run build -- -w",
      "clean": "del-cli dist",
      "validate:runtime": "es-check es5 \"dist/runtime/**/*.js\"",
      "prebuild": "npm run clean",
      "build": "cross-env NODE_ENV=production babel src -d dist --copy-files",
      "postbuild": "npm run validate:runtime",
      "commitlint": "commitlint --from=master",
      "security": "npm audit --production",
      "lint:prettier": "prettier --list-different .",
      "lint:js": "eslint --cache .",
      "lint:spelling": "cspell \"**/*.*\"",
      "lint": "npm-run-all -l -p \"lint:**\"",
      "fix:js": "npm run lint:js -- --fix",
      "fix:prettier": "npm run lint:prettier -- --write",
      "fix": "npm-run-all -l fix:js fix:prettier",
      "test:only": "cross-env NODE_ENV=test jest",
      "test:watch": "npm run test:only -- --watch",
      "test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
      "pretest": "npm run lint",
      "test": "npm run test:coverage",
      "prepare": "husky install && npm run build",
      "release": "standard-version"
    },
    "files": [
      "dist"
    ],
    "peerDependencies": {
      "@rspack/core": "0.x || 1.x",
      "webpack": "^5.0.0"
    },
    "peerDependenciesMeta": {
      "@rspack/core": {
        "optional": true
      },
      "webpack": {
        "optional": true
      }
    },
    "dependencies": {
      "icss-utils": "^5.1.0",
      "postcss": "^8.4.33",
      "postcss-modules-extract-imports": "^3.1.0",
      "postcss-modules-local-by-default": "^4.0.5",
      "postcss-modules-scope": "^3.2.0",
      "postcss-modules-values": "^4.0.0",
      "postcss-value-parser": "^4.2.0",
      "semver": "^7.5.4"
    },
    "devDependencies": {
      "@babel/cli": "^7.23.4",
      "@babel/core": "^7.23.7",
      "@babel/preset-env": "^7.23.7",
      "@commitlint/cli": "^16.3.0",
      "@commitlint/config-conventional": "^16.2.4",
      "@webpack-contrib/eslint-config-webpack": "^3.0.0",
      "babel-jest": "^28.1.3",
      "cross-env": "^7.0.3",
      "cspell": "^6.31.2",
      "del": "^6.1.1",
      "del-cli": "^4.0.1",
      "es-check": "^7.1.0",
      "eslint": "^8.54.0",
      "eslint-config-prettier": "^8.9.0",
      "eslint-plugin-import": "^2.29.0",
      "file-loader": "^6.2.0",
      "husky": "^7.0.1",
      "jest": "^28.1.3",
      "jest-environment-jsdom": "^28.1.3",
      "less": "^4.2.0",
      "less-loader": "^10.0.1",
      "lint-staged": "^12.5.0",
      "memfs": "^3.5.3",
      "mini-css-extract-plugin": "^2.7.5",
      "npm-run-all": "^4.1.5",
      "postcss-loader": "^6.2.1",
      "postcss-preset-env": "^7.8.3",
      "prettier": "^2.8.7",
      "sass": "^1.69.7",
      "sass-loader": "^12.6.0",
      "standard-version": "^9.5.0",
      "strip-ansi": "^6.0.0",
      "style-loader": "^3.3.2",
      "stylus": "^0.59.0",
      "stylus-loader": "^6.1.0",
      "url-loader": "^4.1.1",
      "webpack": "^5.89.0"
    },
    "keywords": [
      "webpack",
      "css",
      "loader",
      "url",
      "import"
    ],
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-css-loader-6.11.0-33bae3bf6363d0a7c2cf9031c96c744ff54d85ba-integrity/node_modules/css-loader/package.json",
    "readmeFilename": "README.md",
    "readme": "<div align=\"center\">\n  <img width=\"180\" height=\"180\" vspace=\"20\"\n    src=\"https://cdn.worldvectorlogo.com/logos/css-3.svg\">\n  <a href=\"https://github.com/webpack/webpack\">\n    <img width=\"200\" height=\"200\"\n      src=\"https://webpack.js.org/assets/icon-square-big.svg\">\n  </a>\n</div>\n\n[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![tests][tests]][tests-url]\n[![coverage][cover]][cover-url]\n[![discussion][discussion]][discussion-url]\n[![size][size]][size-url]\n\n# css-loader\n\nThe `css-loader` interprets `@import` and `url()` like `import/require()` and will resolve them.\n\n## Getting Started\n\n> **Warning**\n>\n> To use the latest version of css-loader, webpack@5 is required\n\nTo begin, you'll need to install `css-loader`:\n\n```console\nnpm install --save-dev css-loader\n```\n\nor\n\n```console\nyarn add -D css-loader\n```\n\nor\n\n```console\npnpm add -D css-loader\n```\n\nThen add the plugin to your `webpack` config. For example:\n\n**file.js**\n\n```js\nimport css from \"file.css\";\n```\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        use: [\"style-loader\", \"css-loader\"],\n      },\n    ],\n  },\n};\n```\n\nAnd run `webpack` via your preferred method.\n\nIf, for one reason or another, you need to extract CSS as a file (i.e. do not store CSS in a JS module) you might want to check out the [recommend example](https://github.com/webpack-contrib/css-loader#recommend).\n\n## Options\n\n- **[`url`](#url)**\n- **[`import`](#import)**\n- **[`modules`](#modules)**\n- **[`sourceMap`](#sourcemap)**\n- **[`importLoaders`](#importloaders)**\n- **[`esModule`](#esmodule)**\n- **[`exportType`](#exporttype)**\n\n### `url`\n\nType:\n\n```ts\ntype url =\n  | boolean\n  | {\n      filter: (url: string, resourcePath: string) => boolean;\n    };\n```\n\nDefault: `true`\n\nAllow to enable/disables handling the CSS functions `url` and `image-set`.\nIf set to `false`, `css-loader` will not parse any paths specified in `url` or `image-set`.\nA function can also be passed to control this behavior dynamically based on the path to the asset.\nStarting with version [4.0.0](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md#400-2020-07-25), absolute paths are parsed based on the server root.\n\nExamples resolutions:\n\n```js\nurl(image.png) => require('./image.png')\nurl('image.png') => require('./image.png')\nurl(./image.png) => require('./image.png')\nurl('./image.png') => require('./image.png')\nurl('http://dontwritehorriblecode.com/2112.png') => require('http://dontwritehorriblecode.com/2112.png')\nimage-set(url('image2x.png') 1x, url('image1x.png') 2x) => require('./image1x.png') and require('./image2x.png')\n```\n\nTo import assets from a `node_modules` path (include `resolve.modules`) and for `alias`, prefix it with a `~`:\n\n```js\nurl(~module/image.png) => require('module/image.png')\nurl('~module/image.png') => require('module/image.png')\nurl(~aliasDirectory/image.png) => require('otherDirectory/image.png')\n```\n\n#### `boolean`\n\nEnable/disable `url()` resolving.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          url: true,\n        },\n      },\n    ],\n  },\n};\n```\n\n#### `object`\n\nAllow to filter `url()`. All filtered `url()` will not be resolved (left in the code as they were written).\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          url: {\n            filter: (url, resourcePath) => {\n              // resourcePath - path to css file\n\n              // Don't handle `img.png` urls\n              if (url.includes(\"img.png\")) {\n                return false;\n              }\n\n              // Don't handle images under root-relative /external_images/\n              if (/^\\/external_images\\//.test(path)) {\n                return false;\n              }\n\n              return true;\n            },\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n### `import`\n\nType:\n\n<!-- use other name to prettify since import is reserved keyword -->\n\n```ts\ntype importFn =\n  | boolean\n  | {\n      filter: (\n        url: string,\n        media: string,\n        resourcePath: string,\n        supports?: string,\n        layer?: string\n      ) => boolean;\n    };\n```\n\nDefault: `true`\n\nAllows to enables/disables `@import` at-rules handling.\nControl `@import` resolving. Absolute urls in `@import` will be moved in runtime code.\n\nExamples resolutions:\n\n```\n@import 'style.css' => require('./style.css')\n@import url(style.css) => require('./style.css')\n@import url('style.css') => require('./style.css')\n@import './style.css' => require('./style.css')\n@import url(./style.css) => require('./style.css')\n@import url('./style.css') => require('./style.css')\n@import url('http://dontwritehorriblecode.com/style.css') => @import url('http://dontwritehorriblecode.com/style.css') in runtime\n```\n\nTo import styles from a `node_modules` path (include `resolve.modules`) and for `alias`, prefix it with a `~`:\n\n```\n@import url(~module/style.css) => require('module/style.css')\n@import url('~module/style.css') => require('module/style.css')\n@import url(~aliasDirectory/style.css) => require('otherDirectory/style.css')\n```\n\n#### `boolean`\n\nEnable/disable `@import` resolving.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          import: true,\n        },\n      },\n    ],\n  },\n};\n```\n\n#### `object`\n\n##### `filter`\n\nType:\n\n```ts\ntype filter = (url: string, media: string, resourcePath: string) => boolean;\n```\n\nDefault: `undefined`\n\nAllow to filter `@import`. All filtered `@import` will not be resolved (left in the code as they were written).\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          import: {\n            filter: (url, media, resourcePath) => {\n              // resourcePath - path to css file\n\n              // Don't handle `style.css` import\n              if (url.includes(\"style.css\")) {\n                return false;\n              }\n\n              return true;\n            },\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n### `modules`\n\nType:\n\n```ts\ntype modules =\n  | boolean\n  | \"local\"\n  | \"global\"\n  | \"pure\"\n  | \"icss\"\n  | {\n      auto: boolean | regExp | ((resourcePath: string) => boolean);\n      mode:\n        | \"local\"\n        | \"global\"\n        | \"pure\"\n        | \"icss\"\n        | ((resourcePath) => \"local\" | \"global\" | \"pure\" | \"icss\");\n      localIdentName: string;\n      localIdentContext: string;\n      localIdentHashSalt: string;\n      localIdentHashFunction: string;\n      localIdentHashDigest: string;\n      localIdentRegExp: string | regExp;\n      getLocalIdent: (\n        context: LoaderContext,\n        localIdentName: string,\n        localName: string\n      ) => string;\n      namedExport: boolean;\n      exportGlobals: boolean;\n      exportLocalsConvention:\n        | \"asIs\"\n        | \"camelCase\"\n        | \"camelCaseOnly\"\n        | \"dashes\"\n        | \"dashesOnly\"\n        | ((name: string) => string);\n      exportOnlyLocals: boolean;\n    };\n```\n\nDefault: `undefined`\n\nAllows to enable/disable CSS Modules or ICSS and setup configuration:\n\n- `undefined` - enable CSS modules for all files matching `/\\.module\\.\\w+$/i.test(filename)` and `/\\.icss\\.\\w+$/i.test(filename)` regexp.\n- `true` - enable CSS modules for all files.\n- `false` - disables CSS Modules for all files.\n- `string` - disables CSS Modules for all files and set the `mode` option, more information you can read [here](https://github.com/webpack-contrib/css-loader#mode)\n- `object` - enable CSS modules for all files, if `modules.auto` option is not specified, otherwise the `modules.auto` option will determine whether if it is CSS modules or not, more information you can read [here](https://github.com/webpack-contrib/css-loader#auto)\n\nThe `modules` option enables/disables the **[CSS Modules](https://github.com/css-modules/css-modules)** specification and setup basic behaviour.\n\nUsing `false` value increase performance because we avoid parsing **CSS Modules** features, it will be useful for developers who use vanilla css or use other technologies.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: true,\n        },\n      },\n    ],\n  },\n};\n```\n\n#### `Features`\n\n##### `Scope`\n\nUsing `local` value requires you to specify `:global` classes.\nUsing `global` value requires you to specify `:local` classes.\nUsing `pure` value requires selectors must contain at least one local class or id.\n\nYou can find more information [here](https://github.com/css-modules/css-modules).\n\nStyles can be locally scoped to avoid globally scoping styles.\n\nThe syntax `:local(.className)` can be used to declare `className` in the local scope. The local identifiers are exported by the module.\n\nWith `:local` (without brackets) local mode can be switched on for this selector.\nThe `:global(.className)` notation can be used to declare an explicit global selector.\nWith `:global` (without brackets) global mode can be switched on for this selector.\n\nThe loader replaces local selectors with unique identifiers. The chosen unique identifiers are exported by the module.\n\n```css\n:local(.className) {\n  background: red;\n}\n:local .className {\n  color: green;\n}\n:local(.className .subClass) {\n  color: green;\n}\n:local .className .subClass :global(.global-class-name) {\n  color: blue;\n}\n```\n\n```css\n._23_aKvs-b8bW2Vg3fwHozO {\n  background: red;\n}\n._23_aKvs-b8bW2Vg3fwHozO {\n  color: green;\n}\n._23_aKvs-b8bW2Vg3fwHozO ._13LGdX8RMStbBE9w-t0gZ1 {\n  color: green;\n}\n._23_aKvs-b8bW2Vg3fwHozO ._13LGdX8RMStbBE9w-t0gZ1 .global-class-name {\n  color: blue;\n}\n```\n\n> **Note**\n>\n> Identifiers are exported\n\n```js\nexports.locals = {\n  className: \"_23_aKvs-b8bW2Vg3fwHozO\",\n  subClass: \"_13LGdX8RMStbBE9w-t0gZ1\",\n};\n```\n\nCamelCase is recommended for local selectors. They are easier to use within the imported JS module.\n\nYou can use `:local(#someId)`, but this is not recommended. Use classes instead of ids.\n\n##### `Composing`\n\nWhen declaring a local classname you can compose a local class from another local classname.\n\n```css\n:local(.className) {\n  background: red;\n  color: yellow;\n}\n\n:local(.subClass) {\n  composes: className;\n  background: blue;\n}\n```\n\nThis doesn't result in any change to the CSS itself but exports multiple classnames.\n\n```js\nexports.locals = {\n  className: \"_23_aKvs-b8bW2Vg3fwHozO\",\n  subClass: \"_13LGdX8RMStbBE9w-t0gZ1 _23_aKvs-b8bW2Vg3fwHozO\",\n};\n```\n\n```css\n._23_aKvs-b8bW2Vg3fwHozO {\n  background: red;\n  color: yellow;\n}\n\n._13LGdX8RMStbBE9w-t0gZ1 {\n  background: blue;\n}\n```\n\n##### `Importing`\n\nTo import a local classname from another module.\n\n> **Note**\n>\n> We strongly recommend that you specify the extension when importing a file, since it is possible to import a file with any extension and it is not known in advance which file to use.\n\n```css\n:local(.continueButton) {\n  composes: button from \"library/button.css\";\n  background: red;\n}\n```\n\n```css\n:local(.nameEdit) {\n  composes: edit highlight from \"./edit.css\";\n  background: red;\n}\n```\n\nTo import from multiple modules use multiple `composes:` rules.\n\n```css\n:local(.className) {\n  composes: edit highlight from \"./edit.css\", button from \"module/button.css\", classFromThisModule;\n  background: red;\n}\n```\n\nor\n\n```css\n:local(.className) {\n  composes: edit highlight from \"./edit.css\";\n  composes: button from \"module/button.css\";\n  composes: classFromThisModule;\n  background: red;\n}\n```\n\n##### `Values`\n\nYou can use `@value` to specific values to be reused throughout a document.\n\nWe recommend use prefix `v-` for values, `s-` for selectors and `m-` for media at-rules.\n\n```css\n@value v-primary: #BF4040;\n@value s-black: black-selector;\n@value m-large: (min-width: 960px);\n\n.header {\n  color: v-primary;\n  padding: 0 10px;\n}\n\n.s-black {\n  color: black;\n}\n\n@media m-large {\n  .header {\n    padding: 0 20px;\n  }\n}\n```\n\n#### `boolean`\n\nEnable **CSS Modules** features.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: true,\n        },\n      },\n    ],\n  },\n};\n```\n\n#### `string`\n\nEnable **CSS Modules** features and setup `mode`.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          // Using `local` value has same effect like using `modules: true`\n          modules: \"global\",\n        },\n      },\n    ],\n  },\n};\n```\n\n#### `object`\n\nEnable **CSS Modules** features and setup options for them.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            mode: \"local\",\n            auto: true,\n            exportGlobals: true,\n            localIdentName: \"[path][name]__[local]--[hash:base64:5]\",\n            localIdentContext: path.resolve(__dirname, \"src\"),\n            localIdentHashSalt: \"my-custom-hash\",\n            namedExport: true,\n            exportLocalsConvention: \"camelCase\",\n            exportOnlyLocals: false,\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `auto`\n\nType:\n\n```ts\ntype auto =\n  | boolean\n  | regExp\n  | ((\n      resourcePath: string,\n      resourceQuery: string,\n      resourceFragment: string\n    ) => boolean);\n```\n\nDefault: `undefined`\n\nAllows auto enable CSS modules/ICSS based on the filename, query or fragment when `modules` option is object.\n\nPossible values:\n\n- `undefined` - enable CSS modules for all files.\n- `true` - enable CSS modules for all files matching `/\\.module\\.\\w+$/i.test(filename)` and `/\\.icss\\.\\w+$/i.test(filename)` regexp.\n- `false` - disables CSS Modules.\n- `RegExp` - enable CSS modules for all files matching `/RegExp/i.test(filename)` regexp.\n- `function` - enable CSS Modules for files based on the filename satisfying your filter function check.\n\n###### `boolean`\n\nPossible values:\n\n- `true` - enables CSS modules or interoperable CSS format, sets the [`modules.mode`](#mode) option to `local` value for all files which satisfy `/\\.module(s)?\\.\\w+$/i.test(filename)` condition or sets the [`modules.mode`](#mode) option to `icss` value for all files which satisfy `/\\.icss\\.\\w+$/i.test(filename)` condition\n- `false` - disables CSS modules or interoperable CSS format based on filename\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            auto: true,\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n###### `RegExp`\n\nEnable CSS modules for files based on the filename satisfying your regex check.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            auto: /\\.custom-module\\.\\w+$/i,\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n###### `function`\n\nEnable CSS modules for files based on the filename, query or fragment satisfying your filter function check.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            auto: (resourcePath, resourceQuery, resourceFragment) => {\n              return resourcePath.endsWith(\".custom-module.css\");\n            },\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `mode`\n\nType:\n\n```ts\ntype mode =\n  | \"local\"\n  | \"global\"\n  | \"pure\"\n  | \"icss\"\n  | ((\n      resourcePath: string,\n      resourceQuery: string,\n      resourceFragment: string\n    ) => \"local\" | \"global\" | \"pure\" | \"icss\");\n```\n\nDefault: `'local'`\n\nSetup `mode` option. You can omit the value when you want `local` mode.\n\nControls the level of compilation applied to the input styles.\n\nThe `local`, `global`, and `pure` handles `class` and `id` scoping and `@value` values.\nThe `icss` will only compile the low level `Interoperable CSS` format for declaring `:import` and `:export` dependencies between CSS and other languages.\n\nICSS underpins CSS Module support, and provides a low level syntax for other tools to implement CSS-module variations of their own.\n\n###### `string`\n\nPossible values - `local`, `global`, `pure`, and `icss`.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            mode: \"global\",\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n###### `function`\n\nAllows set different values for the `mode` option based on the filename, query or fragment.\n\nPossible return values - `local`, `global`, `pure` and `icss`.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            // Callback must return \"local\", \"global\", or \"pure\" values\n            mode: (resourcePath, resourceQuery, resourceFragment) => {\n              if (/pure.css$/i.test(resourcePath)) {\n                return \"pure\";\n              }\n\n              if (/global.css$/i.test(resourcePath)) {\n                return \"global\";\n              }\n\n              return \"local\";\n            },\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `localIdentName`\n\nType:\n\n```ts\ntype localIdentName = string;\n```\n\nDefault: `'[hash:base64]'`\n\nAllows to configure the generated local ident name.\n\nFor more information on options see:\n\n- [webpack template strings](https://webpack.js.org/configuration/output/#template-strings),\n- [output.hashDigest](https://webpack.js.org/configuration/output/#outputhashdigest),\n- [output.hashDigestLength](https://webpack.js.org/configuration/output/#outputhashdigestlength),\n- [output.hashFunction](https://webpack.js.org/configuration/output/#outputhashfunction),\n- [output.hashSalt](https://webpack.js.org/configuration/output/#outputhashsalt).\n\nSupported template strings:\n\n- `[name]` the basename of the resource\n- `[folder]` the folder the resource relative to the `compiler.context` option or `modules.localIdentContext` option.\n- `[path]` the path of the resource relative to the `compiler.context` option or `modules.localIdentContext` option.\n- `[file]` - filename and path.\n- `[ext]` - extension with leading `.`.\n- `[hash]` - the hash of the string, generated based on `localIdentHashSalt`, `localIdentHashFunction`, `localIdentHashDigest`, `localIdentHashDigestLength`, `localIdentContext`, `resourcePath` and `exportName`\n- `[<hashFunction>:hash:<hashDigest>:<hashDigestLength>]` - hash with hash settings.\n- `[local]` - original class.\n\nRecommendations:\n\n- use `'[path][name]__[local]'` for development\n- use `'[hash:base64]'` for production\n\nThe `[local]` placeholder contains original class.\n\n**Note:** all reserved (`<>:\"/\\|?*`) and control filesystem characters (excluding characters in the `[local]` placeholder) will be converted to `-`.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            localIdentName: \"[path][name]__[local]--[hash:base64:5]\",\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `localIdentContext`\n\nType:\n\n```ts\ntype localIdentContex = string;\n```\n\nDefault: `compiler.context`\n\nAllows to redefine basic loader context for local ident name.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            localIdentContext: path.resolve(__dirname, \"src\"),\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `localIdentHashSalt`\n\nType:\n\n```ts\ntype localIdentHashSalt = string;\n```\n\nDefault: `undefined`\n\nAllows to add custom hash to generate more unique classes.\nFor more information see [output.hashSalt](https://webpack.js.org/configuration/output/#outputhashsalt).\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            localIdentHashSalt: \"hash\",\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `localIdentHashFunction`\n\nType:\n\n```ts\ntype localIdentHashFunction = string;\n```\n\nDefault: `md4`\n\nAllows to specify hash function to generate classes .\nFor more information see [output.hashFunction](https://webpack.js.org/configuration/output/#outputhashfunction).\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            localIdentHashFunction: \"md4\",\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `localIdentHashDigest`\n\nType:\n\n```ts\ntype localIdentHashDigest = string;\n```\n\nDefault: `hex`\n\nAllows to specify hash digest to generate classes.\nFor more information see [output.hashDigest](https://webpack.js.org/configuration/output/#outputhashdigest).\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            localIdentHashDigest: \"base64\",\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `localIdentHashDigestLength`\n\nType:\n\n```ts\ntype localIdentHashDigestLength = number;\n```\n\nDefault: `20`\n\nAllows to specify hash digest length to generate classes.\nFor more information see [output.hashDigestLength](https://webpack.js.org/configuration/output/#outputhashdigestlength).\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            localIdentHashDigestLength: 5,\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `hashStrategy`\n\nType: `'resource-path-and-local-name' | 'minimal-subset'`\nDefault: `'resource-path-and-local-name'`\n\nShould local name be used when computing the hash.\n\n- `'resource-path-and-local-name'` Both resource path and local name are used when hashing. Each identifier in a module gets its own hash digest, always.\n- `'minimal-subset'` Auto detect if identifier names can be omitted from hashing. Use this value to optimize the output for better GZIP or Brotli compression.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            hashStrategy: \"minimal-subset\",\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `localIdentRegExp`\n\nType:\n\n```ts\ntype localIdentRegExp = string | RegExp;\n```\n\nDefault: `undefined`\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            localIdentRegExp: /page-(.*)\\.css/i,\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `getLocalIdent`\n\nType:\n\n```ts\ntype getLocalIdent = (\n  context: LoaderContext,\n  localIdentName: string,\n  localName: string\n) => string;\n```\n\nDefault: `undefined`\n\nAllows to specify a function to generate the classname.\nBy default we use built-in function to generate a classname.\nIf the custom function returns `null` or `undefined`, we fallback to the\nbuilt-in function to generate the classname.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            getLocalIdent: (context, localIdentName, localName, options) => {\n              return \"whatever_random_class_name\";\n            },\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `namedExport`\n\nType:\n\n```ts\ntype namedExport = boolean;\n```\n\nDefault: `false`\n\nEnables/disables ES modules named export for locals.\n\n> **Warning**\n>\n> Names of locals are converted to camelcase, i.e. the `exportLocalsConvention` option has\n> `camelCaseOnly` value by default. You can set this back to any other valid option but selectors\n> which are not valid JavaScript identifiers may run into problems which do not implement the entire\n> modules specification.\n\n> **Warning**\n>\n> It is not allowed to use JavaScript reserved words in css class names unless\n> `exportLocalsConvention` is `\"asIs\"`.\n\n**styles.css**\n\n```css\n.foo-baz {\n  color: red;\n}\n.bar {\n  color: blue;\n}\n```\n\n**index.js**\n\n```js\nimport * as styles from \"./styles.css\";\n\nconsole.log(styles.fooBaz, styles.bar);\n// or if using `exportLocalsConvention: \"asIs\"`:\nconsole.log(styles[\"foo-baz\"], styles.bar);\n```\n\nYou can enable a ES module named export using:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          esModule: true,\n          modules: {\n            namedExport: true,\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\nTo set a custom name for namedExport, can use [`exportLocalsConvention`](#exportLocalsConvention) option as a function.\nExample below in the [`examples`](#examples) section.\n\n##### `exportGlobals`\n\nType:\n\n```ts\ntype exportsGLobals = boolean;\n```\n\nDefault: `false`\n\nAllow `css-loader` to export names from global class or id, so you can use that as local name.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            exportGlobals: true,\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `exportLocalsConvention`\n\nType:\n\n```ts\ntype exportLocalsConvention =\n  | \"asIs\"\n  | \"camelCase\"\n  | \"camelCaseOnly\"\n  | \"dashes\"\n  | \"dashesOnly\"\n  | ((name: string) => string);\n```\n\nDefault: based on the `modules.namedExport` option value, if `true` - `camelCaseOnly`, otherwise `asIs`\n\nStyle of exported class names.\n\n###### `string`\n\nBy default, the exported JSON keys mirror the class names (i.e `asIs` value).\n\n|         Name          |   Type   | Description                                                                                      |\n| :-------------------: | :------: | :----------------------------------------------------------------------------------------------- |\n|     **`'asIs'`**      | `string` | Class names will be exported as is.                                                              |\n|   **`'camelCase'`**   | `string` | Class names will be camelized, the original class name will not to be removed from the locals    |\n| **`'camelCaseOnly'`** | `string` | Class names will be camelized, the original class name will be removed from the locals           |\n|    **`'dashes'`**     | `string` | Only dashes in class names will be camelized                                                     |\n|  **`'dashesOnly'`**   | `string` | Dashes in class names will be camelized, the original class name will be removed from the locals |\n\n**file.css**\n\n```css\n.class-name {\n}\n```\n\n**file.js**\n\n```js\nimport { className } from \"file.css\";\n```\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            exportLocalsConvention: \"camelCase\",\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n###### `function`\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            exportLocalsConvention: function (name) {\n              return name.replace(/-/g, \"_\");\n            },\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            exportLocalsConvention: function (name) {\n              return [\n                name.replace(/-/g, \"_\"),\n                // dashesCamelCase\n                name.replace(/-+(\\w)/g, (match, firstLetter) =>\n                  firstLetter.toUpperCase()\n                ),\n              ];\n            },\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n##### `exportOnlyLocals`\n\nType:\n\n```ts\ntype exportOnlyLocals = boolean;\n```\n\nDefault: `false`\n\nExport only locals.\n\n**Useful** when you use **css modules** for pre-rendering (for example SSR).\nFor pre-rendering with `mini-css-extract-plugin` you should use this option instead of `style-loader!css-loader` **in the pre-rendering bundle**.\nIt doesn't embed CSS but only exports the identifier mappings.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            exportOnlyLocals: true,\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n### `importLoaders`\n\nType:\n\n```ts\ntype importLoaders = number;\n```\n\nDefault: `0`\n\nAllows to enables/disables or setups number of loaders applied before CSS loader for `@import` at-rules, CSS modules and ICSS imports, i.e. `@import`/`composes`/`@value value from './values.css'`/etc.\n\nThe option `importLoaders` allows you to configure how many loaders before `css-loader` should be applied to `@import`ed resources and CSS modules/ICSS imports.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        use: [\n          \"style-loader\",\n          {\n            loader: \"css-loader\",\n            options: {\n              importLoaders: 2,\n              // 0 => no loaders (default);\n              // 1 => postcss-loader;\n              // 2 => postcss-loader, sass-loader\n            },\n          },\n          \"postcss-loader\",\n          \"sass-loader\",\n        ],\n      },\n    ],\n  },\n};\n```\n\nThis may change in the future when the module system (i. e. webpack) supports loader matching by origin.\n\n### `sourceMap`\n\nType:\n\n```ts\ntype sourceMap = boolean;\n```\n\nDefault: depends on the `compiler.devtool` value\n\nBy default generation of source maps depends on the [`devtool`](https://webpack.js.org/configuration/devtool/) option. All values enable source map generation except `eval` and `false` value.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          sourceMap: true,\n        },\n      },\n    ],\n  },\n};\n```\n\n### `esModule`\n\nType:\n\n```ts\ntype esModule = boolean;\n```\n\nDefault: `true`\n\nBy default, `css-loader` generates JS modules that use the ES modules syntax.\nThere are some cases in which using ES modules is beneficial, like in the case of [module concatenation](https://webpack.js.org/plugins/module-concatenation-plugin/) and [tree shaking](https://webpack.js.org/guides/tree-shaking/).\n\nYou can enable a CommonJS modules syntax using:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          esModule: false,\n        },\n      },\n    ],\n  },\n};\n```\n\n### `exportType`\n\nType:\n\n```ts\ntype exportType = \"array\" | \"string\" | \"css-style-sheet\";\n```\n\nDefault: `'array'`\n\nAllows exporting styles as array with modules, string or [constructable stylesheet](https://developers.google.com/web/updates/2019/02/constructable-stylesheets) (i.e. [`CSSStyleSheet`](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet)).\nDefault value is `'array'`, i.e. loader exports array of modules with specific API which is used in `style-loader` or other.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        assert: { type: \"css\" },\n        loader: \"css-loader\",\n        options: {\n          exportType: \"css-style-sheet\",\n        },\n      },\n    ],\n  },\n};\n```\n\n**src/index.js**\n\n```js\nimport sheet from \"./styles.css\" assert { type: \"css\" };\n\ndocument.adoptedStyleSheets = [sheet];\nshadowRoot.adoptedStyleSheets = [sheet];\n```\n\n#### `'array'`\n\nThe default export is array of modules with specific API which is used in `style-loader` or other.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.(sa|sc|c)ss$/i,\n        use: [\"style-loader\", \"css-loader\", \"postcss-loader\", \"sass-loader\"],\n      },\n    ],\n  },\n};\n```\n\n**src/index.js**\n\n```js\n// `style-loader` applies styles to DOM\nimport \"./styles.css\";\n```\n\n#### `'string'`\n\n> **Warning**\n>\n> You should not use [`style-loader`](https://github.com/webpack-contrib/style-loader) or [`mini-css-extract-plugin`](https://github.com/webpack-contrib/mini-css-extract-plugin) with this value.\n\n> **Warning**\n>\n> The `esModule` option should be enabled if you want to use it with [`CSS modules`](https://github.com/webpack-contrib/css-loader#modules), by default for locals will be used [named export](https://github.com/webpack-contrib/css-loader#namedexport).\n\nThe default export is `string`.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.(sa|sc|c)ss$/i,\n        use: [\"css-loader\", \"postcss-loader\", \"sass-loader\"],\n      },\n    ],\n  },\n};\n```\n\n**src/index.js**\n\n```js\nimport sheet from \"./styles.css\";\n\nconsole.log(sheet);\n```\n\n#### `'css-style-sheet'`\n\n> **Warning**\n>\n> `@import` rules not yet allowed, more [information](https://web.dev/css-module-scripts/#@import-rules-not-yet-allowed)\n\n> **Warning**\n>\n> You don't need [`style-loader`](https://github.com/webpack-contrib/style-loader) anymore, please remove it.\n\n> **Warning**\n>\n> The `esModule` option should be enabled if you want to use it with [`CSS modules`](https://github.com/webpack-contrib/css-loader#modules), by default for locals will be used [named export](https://github.com/webpack-contrib/css-loader#namedexport).\n\n> **Warning**\n>\n> Source maps are not currently supported in `Chrome` due [bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1174094&q=CSSStyleSheet%20source%20maps&can=2)\n\nThe default export is a [constructable stylesheet](https://developers.google.com/web/updates/2019/02/constructable-stylesheets) (i.e. [`CSSStyleSheet`](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet)).\n\nUseful for [custom elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) and shadow DOM.\n\nMore information:\n\n- [Using CSS Module Scripts to import stylesheets](https://web.dev/css-module-scripts/)\n- [Constructable Stylesheets: seamless reusable styles](https://developers.google.com/web/updates/2019/02/constructable-stylesheets)\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        assert: { type: \"css\" },\n        loader: \"css-loader\",\n        options: {\n          exportType: \"css-style-sheet\",\n        },\n      },\n\n      // For Sass/SCSS:\n      //\n      // {\n      //   assert: { type: \"css\" },\n      //   rules: [\n      //     {\n      //       loader: \"css-loader\",\n      //       options: {\n      //         exportType: \"css-style-sheet\",\n      //         // Other options\n      //       },\n      //     },\n      //     {\n      //       loader: \"sass-loader\",\n      //       options: {\n      //         // Other options\n      //       },\n      //     },\n      //   ],\n      // },\n    ],\n  },\n};\n```\n\n**src/index.js**\n\n```js\n// Example for Sass/SCSS:\n// import sheet from \"./styles.scss\" assert { type: \"css\" };\n\n// Example for CSS modules:\n// import sheet, { myClass } from \"./styles.scss\" assert { type: \"css\" };\n\n// Example for CSS:\nimport sheet from \"./styles.css\" assert { type: \"css\" };\n\ndocument.adoptedStyleSheets = [sheet];\nshadowRoot.adoptedStyleSheets = [sheet];\n```\n\nFor migration purposes, you can use the following configuration:\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        oneOf: [\n          {\n            assert: { type: \"css\" },\n            loader: \"css-loader\",\n            options: {\n              exportType: \"css-style-sheet\",\n              // Other options\n            },\n          },\n          {\n            use: [\n              \"style-loader\",\n              {\n                loader: \"css-loader\",\n                options: {\n                  // Other options\n                },\n              },\n            ],\n          },\n        ],\n      },\n    ],\n  },\n};\n```\n\n## Examples\n\n### Recommend\n\nFor `production` builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.\nThis can be achieved by using the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin), because it creates separate css files.\nFor `development` mode (including `webpack-dev-server`) you can use [style-loader](https://github.com/webpack-contrib/style-loader), because it injects CSS into the DOM using multiple `<style></style>` and works faster.\n\n> **Note**\n>\n> Do not use `style-loader` and `mini-css-extract-plugin` together.\n\n**webpack.config.js**\n\n```js\nconst MiniCssExtractPlugin = require(\"mini-css-extract-plugin\");\nconst devMode = process.env.NODE_ENV !== \"production\";\n\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        // If you enable `experiments.css` or `experiments.futureDefaults`, please uncomment line below\n        // type: \"javascript/auto\",\n        test: /\\.(sa|sc|c)ss$/i,\n        use: [\n          devMode ? \"style-loader\" : MiniCssExtractPlugin.loader,\n          \"css-loader\",\n          \"postcss-loader\",\n          \"sass-loader\",\n        ],\n      },\n    ],\n  },\n  plugins: [].concat(devMode ? [] : [new MiniCssExtractPlugin()]),\n};\n```\n\n### Disable url resolving using the `/* webpackIgnore: true */` comment\n\nWith the help of the `/* webpackIgnore: true */`comment, it is possible to disable sources handling for rules and for individual declarations.\n\n```css\n/* webpackIgnore: true */\n@import url(./basic.css);\n@import /* webpackIgnore: true */ url(./imported.css);\n\n.class {\n  /* Disabled url handling for the all urls in the 'background' declaration */\n  color: red;\n  /* webpackIgnore: true */\n  background: url(\"./url/img.png\"), url(\"./url/img.png\");\n}\n\n.class {\n  /* Disabled url handling for the first url in the 'background' declaration */\n  color: red;\n  background:\n    /* webpackIgnore: true */ url(\"./url/img.png\"), url(\"./url/img.png\");\n}\n\n.class {\n  /* Disabled url handling for the second url in the 'background' declaration */\n  color: red;\n  background: url(\"./url/img.png\"),\n    /* webpackIgnore: true */ url(\"./url/img.png\");\n}\n\n/* prettier-ignore */\n.class {\n  /* Disabled url handling for the second url in the 'background' declaration */\n  color: red;\n  background: url(\"./url/img.png\"),\n    /* webpackIgnore: true */\n    url(\"./url/img.png\");\n}\n\n/* prettier-ignore */\n.class {\n  /* Disabled url handling for third and sixth urls in the 'background-image' declaration */\n  background-image: image-set(\n    url(./url/img.png) 2x,\n    url(./url/img.png) 3x,\n    /* webpackIgnore:  true */ url(./url/img.png) 4x,\n    url(./url/img.png) 5x,\n    url(./url/img.png) 6x,\n    /* webpackIgnore:  true */\n    url(./url/img.png) 7x\n  );\n}\n```\n\n### Assets\n\nThe following `webpack.config.js` can load CSS files, embed small PNG/JPG/GIF/SVG images as well as fonts as [Data URLs](https://tools.ietf.org/html/rfc2397) and copy larger files to the output directory.\n\n**For webpack v5:**\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        use: [\"style-loader\", \"css-loader\"],\n      },\n      {\n        test: /\\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/i,\n        // More information here https://webpack.js.org/guides/asset-modules/\n        type: \"asset\",\n      },\n    ],\n  },\n};\n```\n\n### Extract\n\nFor production builds it's recommended to extract the CSS from your bundle being able to use parallel loading of CSS/JS resources later on.\n\n- This can be achieved by using the [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) to extract the CSS when running in production mode.\n\n- As an alternative, if seeking better development performance and css outputs that mimic production. [extract-css-chunks-webpack-plugin](https://github.com/faceyspacey/extract-css-chunks-webpack-plugin) offers a hot module reload friendly, extended version of mini-css-extract-plugin. HMR real CSS files in dev, works like mini-css in non-dev\n\n### Pure CSS, CSS modules and PostCSS\n\nWhen you have pure CSS (without CSS modules), CSS modules and PostCSS in your project you can use this setup:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        // For pure CSS - /\\.css$/i,\n        // For Sass/SCSS - /\\.((c|sa|sc)ss)$/i,\n        // For Less - /\\.((c|le)ss)$/i,\n        test: /\\.((c|sa|sc)ss)$/i,\n        use: [\n          \"style-loader\",\n          {\n            loader: \"css-loader\",\n            options: {\n              // Run `postcss-loader` on each CSS `@import` and CSS modules/ICSS imports, do not forget that `sass-loader` compile non CSS `@import`'s into a single file\n              // If you need run `sass-loader` and `postcss-loader` on each CSS `@import` please set it to `2`\n              importLoaders: 1,\n            },\n          },\n          {\n            loader: \"postcss-loader\",\n            options: { plugins: () => [postcssPresetEnv({ stage: 0 })] },\n          },\n          // Can be `less-loader`\n          {\n            loader: \"sass-loader\",\n          },\n        ],\n      },\n      // For webpack v5\n      {\n        test: /\\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/i,\n        // More information here https://webpack.js.org/guides/asset-modules/\n        type: \"asset\",\n      },\n    ],\n  },\n};\n```\n\n### Resolve unresolved URLs using an alias\n\n**index.css**\n\n```css\n.class {\n  background: url(/assets/unresolved/img.png);\n}\n```\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        use: [\"style-loader\", \"css-loader\"],\n      },\n    ],\n  },\n  resolve: {\n    alias: {\n      \"/assets/unresolved/img.png\": path.resolve(\n        __dirname,\n        \"assets/real-path-to-img/img.png\"\n      ),\n    },\n  },\n};\n```\n\n### Named export with custom export names\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/i,\n        loader: \"css-loader\",\n        options: {\n          modules: {\n            namedExport: true,\n            exportLocalsConvention: function (name) {\n              return name.replace(/-/g, \"_\");\n            },\n          },\n        },\n      },\n    ],\n  },\n};\n```\n\n### Separating `Interoperable CSS`-only and `CSS Module` features\n\nThe following setup is an example of allowing `Interoperable CSS` features only (such as `:import` and `:export`) without using further `CSS Module` functionality by setting `mode` option for all files that do not match `*.module.scss` naming convention. This is for reference as having `ICSS` features applied to all files was default `css-loader` behavior before v4.\nMeanwhile all files matching `*.module.scss` are treated as `CSS Modules` in this example.\n\nAn example case is assumed where a project requires canvas drawing variables to be synchronized with CSS - canvas drawing uses the same color (set by color name in JavaScript) as HTML background (set by class name in CSS).\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      // ...\n      // --------\n      // SCSS ALL EXCEPT MODULES\n      {\n        test: /\\.scss$/i,\n        exclude: /\\.module\\.scss$/i,\n        use: [\n          {\n            loader: \"style-loader\",\n          },\n          {\n            loader: \"css-loader\",\n            options: {\n              importLoaders: 1,\n              modules: {\n                mode: \"icss\",\n              },\n            },\n          },\n          {\n            loader: \"sass-loader\",\n          },\n        ],\n      },\n      // --------\n      // SCSS MODULES\n      {\n        test: /\\.module\\.scss$/i,\n        use: [\n          {\n            loader: \"style-loader\",\n          },\n          {\n            loader: \"css-loader\",\n            options: {\n              importLoaders: 1,\n              modules: {\n                mode: \"local\",\n              },\n            },\n          },\n          {\n            loader: \"sass-loader\",\n          },\n        ],\n      },\n      // --------\n      // ...\n    ],\n  },\n};\n```\n\n**variables.scss**\n\nFile treated as `ICSS`-only.\n\n```scss\n$colorBackground: red;\n:export {\n  colorBackgroundCanvas: $colorBackground;\n}\n```\n\n**Component.module.scss**\n\nFile treated as `CSS Module`.\n\n```scss\n@import \"variables.scss\";\n.componentClass {\n  background-color: $colorBackground;\n}\n```\n\n**Component.jsx**\n\nUsing both `CSS Module` functionality as well as SCSS variables directly in JavaScript.\n\n```jsx\nimport svars from \"variables.scss\";\nimport styles from \"Component.module.scss\";\n\n// Render DOM with CSS modules class name\n// <div className={styles.componentClass}>\n//   <canvas ref={mountsCanvas}/>\n// </div>\n\n// Somewhere in JavaScript canvas drawing code use the variable directly\n// const ctx = mountsCanvas.current.getContext('2d',{alpha: false});\nctx.fillStyle = `${svars.colorBackgroundCanvas}`;\n```\n\n## Contributing\n\nPlease take a moment to read our contributing guidelines if you haven't yet done so.\n\n[CONTRIBUTING](./.github/CONTRIBUTING.md)\n\n## License\n\n[MIT](./LICENSE)\n\n[npm]: https://img.shields.io/npm/v/css-loader.svg\n[npm-url]: https://npmjs.com/package/css-loader\n[node]: https://img.shields.io/node/v/css-loader.svg\n[node-url]: https://nodejs.org\n[tests]: https://github.com/webpack-contrib/css-loader/workflows/css-loader/badge.svg\n[tests-url]: https://github.com/webpack-contrib/css-loader/actions\n[cover]: https://codecov.io/gh/webpack-contrib/css-loader/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack-contrib/css-loader\n[discussion]: https://img.shields.io/github/discussions/webpack/webpack\n[discussion-url]: https://github.com/webpack/webpack/discussions\n[size]: https://packagephobia.now.sh/badge?p=css-loader\n[size-url]: https://packagephobia.now.sh/result?p=css-loader\n",
    "licenseText": "Copyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/css-loader/-/css-loader-6.11.0.tgz#33bae3bf6363d0a7c2cf9031c96c744ff54d85ba",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/css-loader/-/css-loader-6.11.0.tgz",
    "hash": "33bae3bf6363d0a7c2cf9031c96c744ff54d85ba",
    "integrity": "sha512-CTJ+AEQJjq5NzLga5pE39qdiSV56F8ywCIsqNIRF0r7BDgWsN25aazToqAFg7ZrtA/U016xudB3ffgweORxX7g==",
    "registry": "npm",
    "packageName": "css-loader",
    "cacheIntegrity": "sha512-CTJ+AEQJjq5NzLga5pE39qdiSV56F8ywCIsqNIRF0r7BDgWsN25aazToqAFg7ZrtA/U016xudB3ffgweORxX7g== sha1-M7rjv2Nj0KfCz5AxyWx0T/VNhbo="
  },
  "registry": "npm",
  "hash": "33bae3bf6363d0a7c2cf9031c96c744ff54d85ba"
}