# plover-assets-webpack

> 使用webpack编译前端资源

Latest version **2.0.0** (published 2017-01-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install plover-assets-webpack
pnpm add plover-assets-webpack
yarn add plover-assets-webpack
bun add plover-assets-webpack
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-01-26 |
| First published | 2016-05-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | bencode@163.com |
| Maintainers | bencode |

## Links

- npm: https://www.npmjs.com/package/plover-assets-webpack
- Repository: https://github.com/ploverjs/plover-assets-webpack
- Homepage: https://github.com/ploverjs/plover-assets-webpack#readme
- Issues: https://github.com/ploverjs/plover-assets-webpack/issues
- npm.io page: https://npm.io/package/plover-assets-webpack

## Dependencies (5)

- [mz](https://npm.io/package/mz.md) ~2.4.0
- [debug](https://npm.io/package/debug.md) ~2.2.0
- [get-annotation](https://npm.io/package/get-annotation.md) ~1.1.0
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ~1.6.0
- [output-formatter](https://npm.io/package/output-formatter.md) ~1.0.1

## Recent versions

- 2.0.0 (latest) — 2017-01-26
- 1.2.1 — 2016-10-12
- 1.2.0 — 2016-10-05
- 1.1.0 — 2016-05-19
- 1.0.0 — 2016-05-14

## README

# plover-assets-webpack


[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]


【插件】使用webpack对模块的前端JS资源进行编译。


## 使用说明

### 1. 安装插件和webpack

```
npm install --save plover-assets-webpack webpack
```

### 2. 配置

按约定应用的webpack配置存放在`config/webpack.js`。 模块可以有自己的webpack配置，一般用于通用模块。


应用webpack配置示例：

```js
module.exports = {
  // 配置对modules目录下的前端js文件进行编译
  match: ['modules/**/*.js'],

  module: {
    loaders: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel',
        query: {
          presets: ['es2015']
        }
      }
    ]
  },

  plugins: []
};


// 编译时生效的插件
if (process.env.PLOVER_ASSETS_BUILD) {
  const webpack = require('webpack');
  module.exports.plugins = exports.webpack.plugins.concat([
    new webpack.optimize.UglifyJsPlugin()
  ]);
}
```

[npm-image]: https://img.shields.io/npm/v/plover-assets-webpack.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/plover-assets-webpack
[travis-image]: https://img.shields.io/travis/ploverjs/plover-assets-webpack/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/ploverjs/plover-assets-webpack
[coveralls-image]: https://img.shields.io/codecov/c/github/ploverjs/plover-assets-webpack.svg?style=flat-square
[coveralls-url]: https://codecov.io/github/ploverjs/plover-assets-webpack?branch=master

---
_Source: https://npm.io/package/plover-assets-webpack · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
