Skip to content

Commit

Permalink
docs: improve more
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Apr 8, 2024
1 parent 565362c commit abc0b5f
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const divElement = document.createElement("div");
divElement.className = styles["my-class"];
```

All locals (class names) stored in imported object.
All local variables (class names) are exported as named exports. To achieve this behaviour you also have to setup `modules` option for `css-loader`. For more information consult with `css-loader` [`documentation`](https://github.com/webpack-contrib/css-loader).

**webpack.config.js**

Expand All @@ -138,7 +138,11 @@ module.exports = {
use: [
// The `injectType` option can be avoided because it is default behaviour
{ loader: "style-loader", options: { injectType: "styleTag" } },
"css-loader",
{
loader: "css-loader",
// Uncomment it if you want to use CSS modules
// options: { modules: true }
},
],
},
],
Expand Down Expand Up @@ -184,7 +188,7 @@ const divElement = document.createElement("div");
divElement.className = styles["my-class"];
```

All locals (class names) stored in imported object.
All local variables (class names) are exported as named exports. To achieve this behaviour you also have to setup `modules` option for `css-loader`. For more information consult with `css-loader` [`documentation`](https://github.com/webpack-contrib/css-loader).

**webpack.config.js**

Expand All @@ -199,7 +203,11 @@ module.exports = {
loader: "style-loader",
options: { injectType: "singletonStyleTag" },
},
"css-loader",
{
loader: "css-loader",
// Uncomment it if you want to use CSS modules
// options: { modules: true }
},
],
},
],
Expand Down Expand Up @@ -253,7 +261,7 @@ const divElement = document.createElement("div");
divElement.className = myClass;
```

All locals (class names) stored in `locals` property of imported object.
All local variables (class names) are exported as named exports. To achieve this behaviour you also have to setup `modules` option for `css-loader`. For more information consult with `css-loader` [`documentation`](https://github.com/webpack-contrib/css-loader).

**webpack.config.js**

Expand All @@ -270,7 +278,11 @@ module.exports = {
test: /\.lazy\.css$/i,
use: [
{ loader: "style-loader", options: { injectType: "lazyStyleTag" } },
"css-loader",
{
loader: "css-loader",
// Uncomment it if you want to use CSS modules
// options: { modules: true }
},
],
},
],
Expand Down Expand Up @@ -324,7 +336,7 @@ const divElement = document.createElement("div");
divElement.className = myClass;
```

All locals (class names) stored in `locals` property of imported object.
All local variables (class names) are exported as named exports. To achieve this behaviour you also have to setup `modules` option for `css-loader`. For more information consult with `css-loader` [`documentation`](https://github.com/webpack-contrib/css-loader).

**webpack.config.js**

Expand All @@ -344,7 +356,11 @@ module.exports = {
loader: "style-loader",
options: { injectType: "lazySingletonStyleTag" },
},
"css-loader",
{
loader: "css-loader",
// Uncomment it if you want to use CSS modules
// options: { modules: true }
},
],
},
],
Expand Down

0 comments on commit abc0b5f

Please sign in to comment.