Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@ Then, add the loader to your `webpack` configuration. For example:
**file.js**

```js
import * as css from "file.css";
import * as css from "./file.css";
```

When using `css-loader`(https://github.com/webpack/css-loader), webpack processes the file through configured [loaders] (https://webpack.js.org/concepts/loaders/) and turns it into a JavaScript module.

The imported value is not a native `CSSStyleSheet`. Instead, it is a JavaScript module generated by `css-loader`. When CSS Modules are enabled, the import can contain exported identifiers (such as class name mappings) from the CSS file.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In some cases yes, so it is wrong


If you only want to apply the styles and do not need to access any exports, you can simply write:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesnt reference anything

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to reference imported module clearly


**webpack.config.js**

```js
Expand Down