From 929c0a7f8c45ab36b388cb52e42c72dad89a9116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mati=20K=C3=A4rner?= Date: Wed, 7 Oct 2020 13:14:52 +0300 Subject: [PATCH] Updates README.md for css-loader versions below 3 --- README.md | 18 ++++++++++++++++++ package.json | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f1d9ac5..c82aa8e 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,24 @@ const getLocalIdent = getLocalIdentName(); }, ``` +For `css-loader` versions below `3.*`, `modules` options should be specified in loader `options` block instead: + +```js +const { getLocalIdentName } = require('css-loader-shorter-classnames'); + +const getLocalIdent = getLocalIdentName(); + +// Loader options +{ + // ... + loader: 'css-loader', + options: { + modules: true, + getLocalIdent: getLocalIdent, + }, +}, +``` + ## Enable only for production ```js const { getLocalIdentName } = require('css-loader-shorter-classnames'); diff --git a/package.json b/package.json index fb6ea9e..9ca0638 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "css-loader-shorter-classnames", - "version": "1.0.4", + "version": "1.0.5", "description": "Provides short class name generator for css-loader with CSS Modules enabled", "main": "index.js", "files": [