UNPKG

2.24 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```sh
21npm 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: [
34 new PiletWebpackPlugin({
35 name: piletPkg.name,
36 version: piletPkg.version,
37 piral: piletPkg.piral.name,
38 }),
39 ],
40};
41```
42
43And run `webpack` via your preferred method.
44
45## Options
46
47### `variables`
48
49Allows supplying additional variables to be used as definitions. Similar to the `definePlugin`.
50
51Example:
52
53```js
54const { PiletWebpackPlugin } = require('pilet-webpack-plugin');
55const piletPkg = require('./package.json');
56
57module.exports = {
58 plugins: [
59 new PiletWebpackPlugin({
60 name: piletPkg.name,
61 version: piletPkg.version,
62 piral: piletPkg.piral.name,
63 variables: {
64 PIRAL_CLI_VERSION: require('piral-cli/package.json').version,
65 },
66 }),
67 ],
68};
69```
70
71## Contributing
72
73Contributions in any form are appreciated and much welcome!
74
75Just 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.
76
77## License
78
79This plugin is released using the MIT license.
80
81[npm]: https://img.shields.io/npm/v/pilet-webpack-plugin.svg
82[npm-url]: https://npmjs.com/package/pilet-webpack-plugin
83[node]: https://img.shields.io/node/v/pilet-webpack-plugin.svg
84[node-url]: https://nodejs.org
85[chat]: https://img.shields.io/badge/gitter-piral.io%2Fcommunity-brightgreen.svg
86[chat-url]: https://gitter.im/piral-io/community
87[size]: https://packagephobia.now.sh/badge?p=pilet-webpack-plugin
88[size-url]: https://packagephobia.now.sh/result?p=pilet-webpack-plugin