Skip to content
⭐小程序转换工具 (。>﹏<。)
Branch: develop
Clone or download
Latest commit 5965476 Jul 13, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
screenshots 「Add」screenshots Jul 7, 2019
src 「Add」PluginEs5 Jul 13, 2019
test 「Update」es5 test demo Jul 13, 2019
.gitignore 「Add」PluginEs5 Jul 13, 2019
.npmignore 「Add」PluginClassProperties Jul 7, 2019
LICENSE 「Refactor」 May 3, 2019
README.md 「Update」README.md Jul 13, 2019
gulpfile.ts 「Fix」script May 25, 2019
package.json 「Add」lodash Jul 13, 2019
tsconfig.json 「Add」bin compile field Jul 7, 2019
yarn.lock 「Add」lodash Jul 13, 2019

README.md

applets-conversion-cli


简介


小程序转换工具,支持了较为普遍的转换场景,比如:xml,js,css。目前,只支持「微信」「支付宝」



安装


# npm
npm install applets-conversion-tool -g

# yarn
yarn add applets-conversion-tool global


使用


参数

参数 描述
-s「–src」 path 转换前的输入目录路径
-o「–out」 path 转换后的输出目录路径
-t「–target」 wx, my 输入目录的小程序类型「目前只支持 wx, my」
-e「–expect」 wx, my 输出目录的小程序类型「目前只支持 wx, my」
-5「–es5」 true, false 遇到一些 es6 语法时,是否转为 es5?
-f「–filter」 string 过滤关键字,过滤存在对应关键字在文件路径,默认过滤「node_modules, .tea, .idea」

Demo

# -s
applets-cli -t wx -e my -s test/applets/wechat-demo

# -o
applets-cli -t wx -e my -s test/applets/wechat-demo -o test/applets/wechat-demo-to-alipay

# -f
applets-cli -t wx -e my -s test/applets/wechat-demo -o test/applets/wechat-demo-to-alipay-filter -f expect-filter-dir

# -5
applets-cli -t wx -e my -s test/applets/wechat-demo -o test/applets/wechat-demo-to-alipay-filter-es5 -f expect-filter-dir -5 true


Build


# init
yarn install

# build
./node_modules/gulp/bin/gulp.js


Test


# npm
npm run test

# yarn
yarn test


截图


Wechat

Alipay

Test



TODO


    • json
    • wxs, sjs
    • tt applets
    • class properties「plugin」


License

  Copyright (C) 2019 CaMnter yuanyu.camnter@gmail.com

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
You can’t perform that action at this time.