This repository has been archived by the owner on Aug 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(README): refactor for webpack v2
- Loading branch information
1 parent
b0df970
commit 8aa0828
Showing
1 changed file
with
72 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,79 @@ | ||
# json loader for webpack | ||
[![npm][npm]][npm-url] | ||
[![node][node]][node-url] | ||
[![deps][deps]][deps-url] | ||
[![tests][tests]][tests-url] | ||
[![coverage][cover]][cover-url] | ||
[![chat][chat]][chat-url] | ||
|
||
## Installation | ||
<div align="center"> | ||
<img width="160" height="180" | ||
src="https://worldvectorlogo.com/logos/json.svg"> | ||
<a href="https://github.com/webpack/webpack"> | ||
<img width="200" height="200" | ||
src="https://webpack.js.org/assets/icon-square-big.svg"> | ||
</a> | ||
<h1>JSON Loader</h1> | ||
</div> | ||
|
||
`npm install --save json-loader` | ||
<h2 align="center">Install</h2> | ||
|
||
## Usage | ||
```bash | ||
npm install --save-dev json-loader | ||
``` | ||
|
||
<h2 align="center">Usage</h2> | ||
|
||
**require** | ||
```js | ||
const json = require("json!./file.json") | ||
``` | ||
|
||
**webpack.config.js** | ||
```js | ||
const json = require('file.json') | ||
``` | ||
|
||
``` javascript | ||
var json = require("json-loader!./file.json"); | ||
// => returns file.json content as json parsed object | ||
```js | ||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.json$/, | ||
use: [ 'json-loader' ] | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
## License | ||
<h2 align="center">Maintainer</h2> | ||
|
||
<table> | ||
<tbody> | ||
<tr> | ||
<td align="center"> | ||
<img width="150 height="150" src="https://github.com/sokra.png?s=150"> | ||
<br> | ||
<a href="https://github.com/sokra">Tobias Koppers</a> | ||
</td> | ||
<tr> | ||
<tbody> | ||
</table> | ||
|
||
[npm]: https://img.shields.io/npm/v/json-loader.svg | ||
[npm-url]: https://npmjs.com/package/json-loader | ||
|
||
[node]: https://img.shields.io/node/v/json-loader.svg | ||
[node-url]: https://nodejs.org | ||
|
||
[deps]: https://david-dm.org/webpack/json-loader.svg | ||
[deps-url]: https://david-dm.org/webpack/json-loader | ||
|
||
[tests]: http://img.shields.io/travis/webpack/json-loader.svg | ||
[tests-url]: https://travis-ci.org/webpack/json-loader | ||
|
||
[cover]: https://coveralls.io/repos/github/webpack/json-loader/badge.svg | ||
[cover-url]: https://coveralls.io/github/webpack/json-loader | ||
|
||
MIT (http://www.opensource.org/licenses/mit-license.php) | ||
[chat]: https://badges.gitter.im/webpack/webpack.svg | ||
[chat-url]: https://gitter.im/webpack/webpack |