API

transformFramework

  1. const transformFramework = require('antmove');
  2. const App = transformFramework(); // 得到的 app 实例即可进行转换处理操作

App

use

  • use | Function - App.use(plugin, pluginOptions) - 挂载插件到实例上,可挂载多个,按挂载顺序执行
    • plugin: 转换插件
    • pluginOptions: 转换插件配置项
      • entry | String - 转换源码目录
      • dist | String - 转换后代码输出目录
      • env | String - 编译环境设置(env/prod)
        • 默认值为生产环境

start

  • start | Function - 开始编译操作

示例

  1. const path = require('path');
  2. const transformFramework = require('antmove');
  3. const WechatPlugin = require('@antmove/wx-alipay');
  4. let outputPath = path.join(__dirname, '../../dist');
  5. let inputDirPath = path.join(__dirname, '../../examples/miniprogram-demo/miniprogram');
  6. const App = transformFramework();
  7. App.use(
  8. WechatPlugin,
  9. {
  10. entry: inputDirPath,
  11. dist: outputPath + '/alipaymini-demo',
  12. env: 'development'
  13. })
  14. .start();