This issue recommends a multi-end applet converter – Antmove.
Antmove (Chinese: ant move), is a small program platform development of a unified solution, by writing a code, compiled into different platforms of small program code, support wechat small program, Alipay small program, Baidu intelligent small program, headline small program and more small program platforms.
Antmove features:
Easy to use, one-click conversion
Complete with detailed compile-time logging/run-time logging tools
The compiled code is readable and can be programmed twice
Secondary compilation support
Component conversion support
Antmove conversion principle:
Antmove conversion applet is roughly divided into three stages, namely, before conversion, conversion and conversion
Before conversion, Antmove preprocesses the small program, including determining the platform of the small program, the development environment configured by the user, and determining the complete small program or component dimension of the transformation
In conversion, Antmove processes templates, styles, Json, Js and other files to achieve the purpose of cross-platform development
After conversion, the _antmove file is generated in the converted file, which contains differential support and smoothing for apis, components, and life cycles
Example (wechat to Alipay) :
Install using npm or yarn
Global installation
$ npm install antmove -g
Local installation
$ npm install antmove –save
- Use:
Command execution
Use to switch the terminal to the wechat small program project path that you want to convert and compile
antmove wx-alipay ./dist/alipay-app
Or use the antmove -i command to convert the./wechat-mini/project wechat applet to the./dist/ always-mini /project directory
antmove -i ./wechat-mini/project -o ./dist/alipay-mini/project --env development
Node.js usage
const path = require('path');const transformFramework = require('antmove');const WechatPlugin = require('@antmove/wx-alipay');let outputPath = path.join(__dirname, '../../dist');let inputDirPath = path.join(__dirname, '../../examples/miniprogram-demo/miniprogram');const App = transformFramework();App.use(WechatPlugin,{entry: inputDirPath,dist: outputPath + '/alipaymini-demo',env: 'development'}).start();
You can read more on your own.