# gulp-define-vm-module

> gulp.js plugin for creating modules

Latest version **0.2.5** (published 2015-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-define-vm-module
pnpm add gulp-define-vm-module
yarn add gulp-define-vm-module
bun add gulp-define-vm-module
```

## 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.2.5 |
| Published | 2015-09-25 |
| First published | 2015-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | kimhou |
| Maintainers | honkang |
| Keywords | gulpplugin, gulpfriendly, amd, commonjs, node |

## Links

- npm: https://www.npmjs.com/package/gulp-define-vm-module
- Repository: https://github.com/kimhou/gulp-define-vm-module
- Issues: https://github.com/kimhou/gulp-define-vm-module/issues
- npm.io page: https://npm.io/package/gulp-define-vm-module

## Dependencies (6)

- [through2](https://npm.io/package/through2.md) ^2.0.0
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.4
- [gulp-rename](https://npm.io/package/gulp-rename.md) ^1.2.2
- [through-pipes](https://npm.io/package/through-pipes.md) 0.0.4
- [gulp-derequire](https://npm.io/package/gulp-derequire.md) ^2.1.0
- [gulp-browserify](https://npm.io/package/gulp-browserify.md) ^0.5.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.2.5 (latest) — 2015-09-25
- 0.2.4 — 2015-08-05
- 0.2.3 — 2015-08-05
- 0.2.2 — 2015-08-05
- 0.2.1 — 2015-08-05
- 0.2.0 — 2015-08-05
- 0.1.9 — 2015-08-05
- 0.1.8 — 2015-07-27
- 0.1.7 — 2015-07-27
- 0.1.6 — 2015-07-27
- 0.1.5 — 2015-07-27
- 0.1.4 — 2015-07-27
- 0.1.3 — 2015-07-27
- 0.1.2 — 2015-07-07
- 0.1.1 — 2015-07-07
- … 1 more at https://npm.io/package/gulp-define-vm-module/versions

## README

# gulp-define-vm-module

[![NPM version][npm-image]][npm-url] [![Build status][travis-image]][travis-url] [![Code Climate][codeclimate-image]][codeclimate-url] [![Coverage Status][coverage-image]][coverage-url] [![Dependencies][david-image]][david-url] [![devDependencies][david-dev-image]][david-dev-url]

gulp-define-vm-module 此插件可以将browserify合并规则的源代码合成为CMD风格的模块化文件.

```javascript
define('moduleName', function(require, exports, module){
var mod = (browserify script);
return mod['main_module_num'];
})
```
use Example
```javascript
var defineVMModule = require('gulp-define-vm-module');
gulp.src('path/src/index.js')
            .pipe(defineVMModule({
                moduleName: moduleName
            }))
            .pipe(gulp.dest('dest'));
```
## 合并规则
path 下有 index.js a.js b.js
index.js依赖a.js b.js

生成
dest/moduleName.js

如果有外部依赖则在js中使用window\['require'\](moduleName)引用 (跟子模块依赖区分)
生成代码会自动转成require(moduleName), 内部模块的require会被derequire重命名


## License

This project is distributed under the MIT license.


[travis-url]: http://travis-ci.org/wbyoung/gulp-define-vm-module
[travis-image]: https://secure.travis-ci.org/wbyoung/gulp-define-vm-module.png?branch=master
[npm-url]: https://npmjs.org/package/gulp-define-vm-module
[npm-image]: https://badge.fury.io/js/gulp-define-vm-module.png
[codeclimate-image]: https://codeclimate.com/github/wbyoung/gulp-define-vm-module.png
[codeclimate-url]: https://codeclimate.com/github/wbyoung/gulp-define-vm-module
[coverage-image]: https://coveralls.io/repos/wbyoung/gulp-define-vm-module/badge.png
[coverage-url]: https://coveralls.io/r/wbyoung/gulp-define-vm-module
[david-image]: https://david-dm.org/wbyoung/gulp-define-vm-module.png?theme=shields.io
[david-url]: https://david-dm.org/wbyoung/gulp-define-vm-module
[david-dev-image]: https://david-dm.org/wbyoung/gulp-define-vm-module/dev-status.png?theme=shields.io
[david-dev-url]: https://david-dm.org/wbyoung/gulp-define-vm-module#info=devDependencies

[gulp-define-vm-module]: https://github.com/wbyoung/gulp-define-vm-module
[gulp-handlebars]: https://github.com/lazd/gulp-handlebars
[gulp-ember-emblem]: https://github.com/wbyoung/gulp-ember-emblem
[lodash.template]: http://lodash.com/docs#template

---
_Source: https://npm.io/package/gulp-define-vm-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
