1 Star 2 Fork 0

FastTunnel / compile2ant

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
README.md 1.51 KB
Copy Edit Web IDE Raw Blame History
Gui.H authored 2020-12-30 18:49 . Update README.md

compile2ant

npm NPM npm

wepy2.0.x 编译为支付宝小程序代码插件

注意事项

插件仅支持 2.0.0-alpha.21之后的版本,请将cli先升级至最新版。

npm install @wepy/cli@next -g

安装

由于个人精力有限,测试未覆盖支付宝小程序的所有api
如编译后不能正常运行,请提交 issue 或直接 pr,会及时进行兼容

npm install compile2ant -save-dev

配置

wepy.config.js

const antPlugin = require('compile2ant');

module.exports = {
  ...
  plugins: [
    antPlugin()
  ],
  ...
}

编译

直接执行以下命令

./node_modules/.bin/wepy build -o ant -t ant --watch

或在 package.json添加scripts如下, 可执行 npm run ant 进行编译

{
  "name": "xxx",
  "version": "0.0.2",
  "description": "A WePY project",
  "main": "weapp/app.js",
  "scripts": {
    ...
    "ant": "./node_modules/.bin/wepy build -o ant -t ant --watch",
    ...
  },
  ...
 }

重要的事情

支付宝小程序 启用 component2 编译 一定要开启
支付宝小程序 启用 component2 编译 一定要开启
支付宝小程序 启用 component2 编译 一定要开启

注释编译后的vendor.js最后一行代码如下

// Function("r", "regeneratorRuntime = r")(runtime)

MIT

Comment ( 0 )

Sign in for post a comment

JavaScript
1
https://gitee.com/Hgui/compile2ant.git
git@gitee.com:Hgui/compile2ant.git
Hgui
compile2ant
compile2ant
master

Search