parse-dep-weexunify
v1.0.2
Published
parse dependency for code generated by webpack
Downloads
11
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
的冗余依赖