# webpack-uncomment-block

> Uncomment the code block

Latest version **0.0.4** (published 2017-07-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install webpack-uncomment-block
pnpm add webpack-uncomment-block
yarn add webpack-uncomment-block
bun add webpack-uncomment-block
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2017-07-19 |
| First published | 2017-07-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Luehoin@gmail.com |
| Maintainers | luehoin |

## Links

- npm: https://www.npmjs.com/package/webpack-uncomment-block
- Repository: https://github.com/LHoin/webpack-uncomment-block
- Homepage: https://github.com/LHoin/webpack-uncomment-block#readme
- Issues: https://github.com/LHoin/webpack-uncomment-block/issues
- npm.io page: https://npm.io/package/webpack-uncomment-block

## Dependencies (3)

- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [packing-glob](https://npm.io/package/packing-glob.md) ^1.0.1
- [pug-strip-comments](https://npm.io/package/pug-strip-comments.md) ^1.0.2

## Recent versions

- 0.0.4 (latest) — 2017-07-19
- 0.0.3 — 2017-07-12
- 0.0.2 — 2017-07-07
- 0.0.1 — 2017-07-07

## README

# 用于取消注释代码片段的webpack插件

## 使用方法
```
const UncommentBlock = require('webpack-uncomment-block'); 
const uncommentBlockPlugin = new UncommentBlock({
  cwd: 'src/html', // 工作目录
  src: '**/*.html ', // 处理文件
  dest: 'prd/html', // 输出目录
  pattern: 'html' // String, RegExp或者Function。默认值为'html'
});
```

### pattern可选值
String: 'html', 'js', 'css'；预置对3种代码处理。
RegExp: 使用正则来替换注释代码。
Function: 接受一个字符串参数，该参数为文件内容，返回处理后的字符串。 

## 使用效果：

### 原始html代码
```
<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <title>Rights Management</title>
    <!-- comment-open
    <link rel="stylesheet" href="/vendor.css" />
    <link rel="stylesheet" href="/rights/index.css" />
    -->
  </head>
  <body>
    <div id="root">
    </div>
    <script src="/vendor.js"></script>
    <script src="/rights/index.js"></script>
  </body>
</html>
```
### 处理后代码
```
<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
    <title>Rights Management</title>
    
    <link rel="stylesheet" href="/vendor.css" />
    <link rel="stylesheet" href="/rights/index.css" />
    
  </head>
  <body>
    <div id="root">
    </div>
    <script src="/vendor.js"></script>
    <script src="/rights/index.js"></script>
  </body>
</html>
```

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