Skip to content

Commit fb457e5

Browse files
danny-andrews-snapevilebottnawi
authored andcommitted
docs(readme): add an example how to @import a node module (webpack-contrib#777)
* Add example of @import'ing a node module The syntax for importing a node_module is not easy to find (see webpack/webpack#1789 (comment)). Maybe this will help a few people out. * Incorporate PR Suggestions
1 parent e3bb83a commit fb457e5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ url(~module/image.png) => require('module/image.png')
115115

116116
### `import`
117117

118+
To import styles from a node module path, prefix it with a `~`:
119+
120+
```css
121+
@import '~module/styles.css';
122+
```
123+
118124
To disable `@import` resolving by `css-loader` set the option to `false`
119125

120126
```css

0 commit comments

Comments
 (0)