Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit 2795242

Browse files
authored
Update README.md
1 parent 947da9c commit 2795242

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<h1>RAW Loader</h1>
1616
</div>
1717

18+
A loader for webpack that lets you import files as a string.
19+
1820
<h2 align="center">Install</h2>
1921

2022
```bash
@@ -23,16 +25,11 @@ npm install --save-dev raw-loader
2325

2426
<h2 align="center">Usage</h2>
2527

26-
**require**
27-
```js
28-
const txt = require("raw!./file.txt")
29-
```
28+
Use the loader either via your webpack config or manually.
3029

31-
**webpack.config.js**
32-
```js
33-
const txt = require('file.txt')
34-
```
30+
### Via webpack config (recommended)
3531

32+
**webpack.config.js**
3633
```js
3734
module.exports = {
3835
module: {
@@ -46,7 +43,19 @@ module.exports = {
4643
}
4744
```
4845

49-
<h2 align="center">Maintainer</h2>
46+
**In your application**
47+
```js
48+
import txt from 'file.txt';
49+
```
50+
51+
### Manually
52+
53+
**In your application**
54+
```js
55+
import txt from 'raw-loader!./file.txt';
56+
```
57+
58+
<h2 align="center">Maintainers</h2>
5059

5160
<table>
5261
<tbody>

0 commit comments

Comments
 (0)