# parse-dep-weexunify

> parse dependency for code generated by webpack

Latest version **1.0.2** (published 2018-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse-dep-weexunify
pnpm add parse-dep-weexunify
yarn add parse-dep-weexunify
bun add parse-dep-weexunify
```

## 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 | 1.0.2 |
| Published | 2018-01-14 |
| First published | 2017-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | chenllos |
| Maintainers | chenllos |
| Keywords | parse-dep, webpack |

## Links

- npm: https://www.npmjs.com/package/parse-dep-weexunify
- Repository: https://github.com/tmallfe/parse-dep-weexunify
- Homepage: https://github.com/tmallfe/parse-dep-weexunify#readme
- Issues: https://github.com/tmallfe/parse-dep-weexunify/issues
- npm.io page: https://npm.io/package/parse-dep-weexunify

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [astw-babylon](https://npm.io/package/astw-babylon.md) ^1.0.0
- [tapc-amd-wrap](https://npm.io/package/tapc-amd-wrap.md) ^0.1.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-01-14
- 1.0.1 — 2017-07-17

## README

# dependency scaner for webpack generated code
use `astw-babylon` as ast parser and walker, collect `require()`'s param, which is dependency of current file.

accept three arguments: `file(gulp Vinyl对象), dependencies(空对象, 做引用传递), options(编译配置)`

returns nothing, but modify `dependencies` object to 对象结构: `{ requires: [depA, depB] }`

push `vue-lib, vue-render` for vue generated web code. `vue-patch` not handled yet.

# 功能
* 通过ast walk, 解析`define/require`中声明的单个/多个依赖
* 针对非`Literal String`的依赖报警, 变量依赖会导致在native端无法运行
* 给web代码添加`weex三端代码统一三件套`的依赖: `vuejs/runtime, vuejs/render, weex-vue-patch/index`
* 忽略`vue-loader`打包web代码时生成的`vue, vue-loader, css-loader`的冗余依赖

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