Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gajus/prepack-webpack-plugin
A webpack plugin for prepack.
https://github.com/gajus/prepack-webpack-plugin
plugin prepack webpack
Last synced: 6 days ago
JSON representation
A webpack plugin for prepack.
- Host: GitHub
- URL: https://github.com/gajus/prepack-webpack-plugin
- Owner: gajus
- License: other
- Created: 2017-05-03T17:46:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-07T19:14:38.000Z (about 6 years ago)
- Last Synced: 2024-11-17T10:52:09.078Z (26 days ago)
- Topics: plugin, prepack, webpack
- Language: JavaScript
- Size: 173 KB
- Stars: 1,038
- Watchers: 19
- Forks: 46
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - prepack-webpack-plugin - A webpack plugin for prepack. (JavaScript)
README
# prepack-webpack-plugin
[![Travis build status](http://img.shields.io/travis/gajus/prepack-webpack-plugin/master.svg?style=flat-square)](https://travis-ci.org/gajus/prepack-webpack-plugin)
[![Coveralls](https://img.shields.io/coveralls/gajus/prepack-webpack-plugin.svg?style=flat-square)](https://github.com/gajus/prepack-webpack-plugin)
[![NPM version](http://img.shields.io/npm/v/prepack-webpack-plugin.svg?style=flat-square)](https://www.npmjs.org/package/prepack-webpack-plugin)
[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)A webpack plugin for [prepack](https://prepack.io/).
## Usage
1. Install `prepack-webpack-plugin`.
1. Add an instance of the plugin to the webpack [plugin configuration](https://webpack.js.org/configuration/plugins/).> Note that this plugin only works with **webpack 4.x**
### Configuration
|Name|Description|Default|
|---|---|---|
|`test`|A regex used to match the files.|`/\.js($\|\?)/i`|
|`prepack`|Prepack configuration. See [Prepack documentation](https://prepack.io/getting-started.html#options).|## Example
```js
import PrepackWebpackPlugin from 'prepack-webpack-plugin';const configuration = {};
module.exports = {
// ...
plugins: [
new PrepackWebpackPlugin(configuration)
]
};```
> If you are using commonjs, you must explicitly reference the `.default` property of the module, e.g.
>
> ```js
> const PrepackWebpackPlugin = require('prepack-webpack-plugin').default;
>
> const configuration = {};
>
> module.exports = {
> // ...
> plugins: [
> new PrepackWebpackPlugin(configuration)
> ]
> };
>
> ```