UNPKG

2.92 kBMarkdownView Raw
1<div align="center">
2 <a href="https://github.com/webpack/webpack">
3 <img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg">
4 </a>
5</div>
6
7[![npm][npm]][npm-url]
8[![node][node]][node-url]
9[![deps][deps]][deps-url]
10[![tests][tests]][tests-url]
11[![cover][cover]][cover-url]
12[![chat][chat]][chat-url]
13[![size][size]][size-url]
14
15# ${package}
16
17${description}
18
19## Getting Started
20
21To begin, you'll need to install `${package}`:
22
23```console
24$ npm install ${package} --save-dev
25```
26
27<!-- isLoader ? use(this) : delete(isPlugin) -->
28Then add the loader to your `webpack` config. For example:
29
30<!-- isPlugin ? use(this) : delete(isLoader) -->
31Then add the plugin to your `webpack` config. For example:
32
33**file.ext**
34```js
35import file from 'file.ext';
36```
37
38<!-- isLoader ? use(this) : delete(isPlugin) -->
39**webpack.config.js**
40
41```js
42module.exports = {
43 module: {
44 rules: [
45 {
46 test: /\.ext$/,
47 use: [
48 {
49 loader: `${name.toLowerCase()}-loader`,
50 options: {...options}
51 }
52 ]
53 }
54 ]
55 }
56}
57```
58
59<!-- isPlugin ? use(this) : delete(isLoader) -->
60**webpack.config.js**
61
62```js
63module.exports = {
64 plugins: [
65 new `${name}`Plugin(options)
66 ]
67}
68```
69
70And run `webpack` via your preferred method.
71
72## Options
73
74### `[option]`
75
76Type: `[type|other-type]`
77Default: `[type|null]`
78
79[ option description ]
80
81<!-- isLoader ? use(this) : delete(isPlugin) -->
82```js
83// in your webpack.config.js
84{
85 loader: `${name.toLowerCase()}-loader`,
86 options: {
87 [option]: ''
88 }
89}
90```
91
92<!-- isPlugin ? use(this) : delete(isLoader) -->
93```js
94// in your webpack.config.js
95new `${name}`Plugin({
96 [option]: ''
97})
98```
99
100## Examples
101
102[ example outline text ]
103
104**webpack.config.js**
105```js
106// Example setup here..
107```
108
109**file.ext**
110```js
111// Source code here...
112```
113
114**bundle.js**
115```js
116// Bundle code here...
117```
118
119## Contributing
120
121Please take a moment to read our contributing guidelines if you haven't yet done so.
122
123[CONTRIBUTING](./.github/CONTRIBUTING.md)
124
125## License
126
127[MIT](./LICENSE)
128
129[npm]: https://img.shields.io/npm/v/${package}.svg
130[npm-url]: https://npmjs.com/package/${package}
131
132[node]: https://img.shields.io/node/v/${package}.svg
133[node-url]: https://nodejs.org
134
135[deps]: https://david-dm.org/webpack-contrib/${package}.svg
136[deps-url]: https://david-dm.org/webpack-contrib/${package}
137
138[tests]: https://img.shields.io/circleci/project/github/webpack-contrib/${package}.svg
139[tests-url]: https://circleci.com/gh/webpack-contrib/${package}
140
141[cover]: https://codecov.io/gh/webpack-contrib/${package}/branch/master/graph/badge.svg
142[cover-url]: https://codecov.io/gh/webpack-contrib/${package}
143
144[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
145[chat-url]: https://gitter.im/webpack/webpack
146
147[size]: https://packagephobia.now.sh/badge?p=${package}
148[size-url]: https://packagephobia.now.sh/result?p=${package}