Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@finclip/applet-builder-ci

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@finclip/applet-builder-ci

```js const { build } = require('@finclip/applet-builder-ci')

  • 1.0.3
  • npm
  • Socket score

Version published
Weekly downloads
45
increased by181.25%
Maintainers
1
Weekly downloads
 
Created
Source

编译小程序

const { build } = require('@finclip/applet-builder-ci')

(async () => {
  /**
   * 
   * @param {Object} options - 编译参数
   * @param {string} options.input - 小程序路径
   * @param {string} options.output - 输出路径
   * @param {boolean} options.zip - 是否输出 zip 包
   * @returns Promise
   */ 
  const builder = await build({
    input: '/path/to/miniprogram',
    output: '/path/to/output/dir',
    zip: true,
    dsl: {
      alias: ['foo', 'bar'],
      prefix: 'ft',
      wxml: 'fxml',
      wxss: 'ftss',
      wxs: 'fts',
      finClipConf: 'FinClipConf.js'
    },
    watch: {
      exclude: [], // watch需要忽略的目录与文件 支持glob与正则
    },
    exclude: [] //打包时需要忽略的目录与文件 支持glob与正则
  })
  if (watch) { // 是否开启watch
    builder.pause() //是否停止watch
    builder.resume() //是否重启watch
  }
})()

构建 npm

const { packNpm } = require('@finclip/applet-builder-ci')
(async () => {
 /**
   * 
   * @param {string} project - 小程序路径
   * @param {Object} options - 编译参数
   * @param {[string]} options.ignores - 指定构建npm需要排除的规则
   * @param {string} options.reporter - 构建回调信息
   * @returns Promise
   */ 
  // 在有需要的时候构建npm
  await packNpm(project, {
    ignores: ['pack_npm_ignore_list'],
    reporter: (infos) => { console.log(infos) }
  })
})()

自定义 node_modules 位置的构建 npm

const { packNpmManually } = require('@finclip/applet-builder-ci')
(async () => {
 /**
   * 
   * @param {Object} options - 编译参数
   * @param {string} options.packageJsonPath - 希望被构建的node_modules 对应的 package.json 的路径
   * @param {string} options.miniprogramNpmDistDir - 被构建 miniprogram_npm 的目标位置目标位置
   * @param {[string]} options.ignores - 指定需要排除的规则
   * @returns Promise
   */ 
  // 在有需要的时候构建npm
  await packNpmManually({
    packageJsonPath: './lib/package.json',
    miniprogramNpmDistDir: './miniprogram-project/miniprogram/'
  })
})()

FAQs

Package last updated on 11 Jul 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc