Skip to content
This repository was archived by the owner on Nov 5, 2019. It is now read-only.

Commit ac41d50

Browse files
michael-ciniawskyjoshwiens
authored andcommitted
docs(README): refactor for webpack v2
1 parent 157a02d commit ac41d50

File tree

1 file changed

+78
-9
lines changed

1 file changed

+78
-9
lines changed

README.md

Lines changed: 78 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,85 @@
1-
# script loader for webpack
1+
[![npm][npm]][npm-url]
2+
[![node][node]][node-url]
3+
[![deps][deps]][deps-url]
4+
[![tests][tests]][tests-url]
5+
[![coverage][cover]][cover-url]
6+
[![chat][chat]][chat-url]
27

3-
## Usage
8+
<div align="center">
9+
<a href="https://github.com/webpack/webpack">
10+
<img width="200" height="200"
11+
src="https://webpack.js.org/assets/icon-square-big.svg">
12+
</a>
13+
<h1>Script Loader</h1>
14+
</div>
415

5-
``` javascript
6-
require("script-loader!./file.js");
7-
// => execute file.js once in global context
16+
<h2 align="center">Install</h2>
17+
18+
```bash
19+
npm install --save-dev script-loader
20+
```
21+
22+
<h2 align="center">Usage</h2>
23+
24+
Executes JS script once in global context.
25+
26+
> :wanring: Doesn't work in NodeJS
27+
28+
### Config (recommended)
29+
30+
```js
31+
import exec from 'script.exec.js';
32+
```
33+
34+
**webpack.config.js**
35+
```js
36+
module.exports = {
37+
module: {
38+
rules: [
39+
{
40+
test: /\.exec.js$/,
41+
use: [ 'script-loader' ]
42+
}
43+
]
44+
}
45+
}
846
```
947

10-
[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)
48+
### Inline
49+
50+
```js
51+
import exec from 'script-loader!./script.js';
52+
```
53+
54+
<h2 align="center">Maintainer</h2>
55+
56+
<table>
57+
<tbody>
58+
<tr>
59+
<td align="center">
60+
<img width="150 height="150" src="https://github.com/sokra.png?s=150">
61+
<br>
62+
<a href="https://github.com/sokra">Tobias Koppers</a>
63+
</td>
64+
<tr>
65+
<tbody>
66+
</table>
67+
68+
69+
[npm]: https://img.shields.io/npm/v/script-loader.svg
70+
[npm-url]: https://npmjs.com/package/script-loader
71+
72+
[node]: https://img.shields.io/node/v/script-loader.svg
73+
[node-url]: https://nodejs.org
74+
75+
[deps]: https://david-dm.org/webpack/script-loader.svg
76+
[deps-url]: https://david-dm.org/webpack/script-loader
1177

12-
Does nothing in node.js.
78+
[tests]: http://img.shields.io/travis/webpack/script-loader.svg
79+
[tests-url]: https://travis-ci.org/webpack/script-loader
1380

14-
## License
81+
[cover]: https://coveralls.io/repos/github/webpack/script-loader/badge.svg
82+
[cover-url]: https://coveralls.io/github/webpack/script-loader
1583

16-
MIT (http://www.opensource.org/licenses/mit-license.php)
84+
[chat]: https://badges.gitter.im/webpack/webpack.svg
85+
[chat-url]: https://gitter.im/webpack/webpack

0 commit comments

Comments
 (0)