
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@weimob-cloud/matrix
Advanced tools
这是一个尝试将 微信小程序的组件或页面 转换成 React组件 的编译转换工具。 同时也支持带条件编译的小程序代码编译为小程序平台的代码和H5平台的React代码。
$ npm install @weimob-cloud/matrix --save
const wmatrix = require('@weimob-cloud/matrix')
wmatrix.build(options)
字段 | 类型 | 含义 | 默认值/参数 | 可选值 |
---|---|---|---|---|
root | String | 项目根目录 | process.cwd() | - |
target | String | 编译目标平台 | all | all h5 xapp |
entry | String/Array | 待编译的组件的相对路径 | ./wmxapp | ./wmxapp 该目录下所有组件 \ ./wmxapp/comp1 ./wmxapp/comp2 指定单个组件或多个组件 |
outdirh5 | String | h5平台的编译输出路径 | ./web | - |
outdirxapp | String | 小程序平台的编译输出路径 | ./xapp | - |
done | Function | 编译完成后的回调函数 | f(成功组件,失败组件,耗时){} | - |
$ npm install -g @weimob-cloud/matrix
$ matrix -r /Users/xxx/.../myproject -e ./wmxapp/comp1 ./wmxapp/comp2 -oh ./web -ox ./xapp
or
$ matrix -e ./xapp
option | 简写 | 含义 | 默认值/参数 | 可选值 |
---|---|---|---|---|
--root | -r | 项目根目录 | process.cwd() | - |
--target | -t | 编译目标平台 | all | all h5 xapp |
--entry | -e | 待编译的组件的相对路径 | ./wmxapp | - |
--outdirh5 | -oh | h5平台的编译输出路径 | ./web | - |
--outdirxapp | -ox | 小程序平台的编译输出路径 | ./xapp | - |
.npmrc
在vscode工具中配置launch.json
$ npm run build
注:打包后最好测试一下功能是否正常,因为开发用ESM,打包后是CommonJS,会有部分差异。
FAQs
Command line interface for convert miniprogram to react.
The npm package @weimob-cloud/matrix receives a total of 0 weekly downloads. As such, @weimob-cloud/matrix popularity was classified as not popular.
We found that @weimob-cloud/matrix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.