Skip to content

Commit 07ea44b

Browse files
EugeneHlushkomontogeek
authored andcommitted
docs(loaders) document prefixing inline imports (#2987)
* docs(loaders) document prefixing inline imports * docs(loaders) make phrasing consistent across the list * Update src/content/concepts/loaders.mdx * docs(loaders) loaders prefixes clarified
1 parent 0efc218 commit 07ea44b

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/content/concepts/loaders.mdx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,25 @@ It's possible to specify loaders in an `import` statement, or any [equivalent "i
9494
import Styles from 'style-loader!css-loader?modules!./styles.css';
9595
```
9696

97-
It's possible to override any loaders in the configuration by prefixing the entire rule with `!`.
97+
It's possible to override any loaders, preLoaders and postLoaders from the [configuration](/configuration) by prefixing the inline `import` statement:
98+
99+
- Prefixing with `!` will disable all configured normal loaders
100+
101+
```js
102+
import Styles from '!style-loader!css-loader?modules!./styles.css';
103+
```
104+
105+
- Prefixing with `!!` will disable all configured loaders (preLoaders, loaders, postLoaders)
106+
107+
```js
108+
import Styles from '!!style-loader!css-loader?modules!./styles.css';
109+
```
110+
111+
- Prefixing with `-!` will disable all configured preLoaders and loaders but not postLoaders
112+
113+
```js
114+
import Styles from '-!style-loader!css-loader?modules!./styles.css';
115+
```
98116

99117
Options can be passed with a query parameter, e.g. `?key=value&foo=bar`, or a JSON object, e.g. `?{"key":"value","foo":"bar"}`.
100118

0 commit comments

Comments
 (0)