UNPKG

2.06 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[![chat][chat]][chat-url]
10[![size][size]][size-url]
11
12# pilet-webpack-plugin
13
14The `pilet-webpack-plugin` helps you to build pilets using Webpack.
15
16## Getting Started
17
18To begin, you'll need to install `pilet-webpack-plugin`:
19
20```console
21$ npm install pilet-webpack-plugin --save-dev
22```
23
24Then add the plugin to your `webpack` config. For example:
25
26**webpack.config.js**
27
28```js
29const { PiletWebpackPlugin } = require('pilet-webpack-plugin');
30const piletPkg = require('./package.json');
31
32module.exports = {
33 plugins: [new PiletWebpackPlugin(piletPkg)],
34};
35```
36
37And run `webpack` via your preferred method.
38
39## Options
40
41### `variables`
42
43Allows supplying additional variables to be used as definitions. Similar to the `definePlugin`.
44
45Example:
46
47```js
48const { PiletWebpackPlugin } = require('pilet-webpack-plugin');
49const piletPkg = require('./package.json');
50
51module.exports = {
52 plugins: [
53 new PiletWebpackPlugin(piletPkg, {
54 variables: {
55 PIRAL_CLI_VERSION: require('piral-cli/package.json').version,
56 },
57 }),
58 ],
59};
60```
61
62## Contributing
63
64Contributions in any form are appreciated and much welcome!
65
66Just make sure to post an issue or reach out to me on [Gitter](https://gitter.im/piral-io/community) before starting actual work on anything. It really helps to avoid problems.
67
68## License
69
70This plugin is released using the MIT license.
71
72[npm]: https://img.shields.io/npm/v/pilet-webpack-plugin.svg
73[npm-url]: https://npmjs.com/package/pilet-webpack-plugin
74[node]: https://img.shields.io/node/v/pilet-webpack-plugin.svg
75[node-url]: https://nodejs.org
76[chat]: https://img.shields.io/badge/gitter-piral.io%2Fcommunity-brightgreen.svg
77[chat-url]: https://gitter.im/piral-io/community
78[size]: https://packagephobia.now.sh/badge?p=pilet-webpack-plugin
79[size-url]: https://packagephobia.now.sh/result?p=pilet-webpack-plugin