1.1.9 • Published 3 years ago

@qihoo/seapp-builder v1.1.9

Weekly downloads
47
License
MIT
Repository
-
Last release
3 years ago

seapp builder

  1. 360 小程序构建工具,用于构建开发者基于360小程序开发文档编写的源代码,使其能够运行在360小程序平台。
  2. 360 小游戏构建工具,用于构建开发者基于微信小游戏编写的源代码,使其能够运行在360小游戏平台。

TIP

v1.1.x 小程序

  • 支持 css 预处理器 Sass/Less
    • 默认支持的预处理器由 全局样式表app.css决定(app.scss -> 选用sass,less同理)
    • 存在 app.css/app.less/app.scss 时, 优先选择权 app.scss > app.less > app.css
  • 支持 vuex 状态管理
    • 需要在根目录下的app.json文件中添加 store 字段,store 类型为字符串,值为 store文件相对路径(参考pages的路径规则)。
    • store文件中,直接导出Vuex.store实例化的参数选项即可。
    • Vuex默认挂在到全局的window下。

v1.1.x 小游戏

  • 支持 qhgame-adapter.js自动引入

  • 支持 开发模式下的wacht功能

  • 支持 生产环境下的代码压缩功能

ENV

  • node >= 8.9
  • npm | yarn
  • 以下使用 npx 时要求 npm >= 5.2

Install

npm install @qihoo/seapp-builder

Usage

在 360mp 项目下使用

Usage: builder <command> [options]

Options:
  -V, --version  output the version number
  -h, --help     output usage information

Commands:
  build          build project in production mode
  watch          build project in development mode and watch file  

  Run builder <command> --help for detailed usage of given command.

在 360gm 项目下使用

Usage: gamebuilder <command> [options]

Options:
  -V, --version  output the version number
  -h, --help     output usage information

Commands:
  build          build project in production mode
  watch          build project in development mode and watch file  

  Run gamebuilder <command> --help for detailed usage of given command.

在 package.json 中配置使用

一、小程序

{
  "scripts": {
    "serve": "builder watch",
    "build": "builder build"
  }
}

二、小游戏

{
  "scripts": {
    "serve": "gamebuilder watch",
    "build": "gamebuilder build"
  }
}

通过 npx | yarn 使用

  • 已项目安装
# 可以监听项目文件 实时构建
1. 小程序:`npx builder watch`

2. 小游戏: `npx gamebuilder watch`

# 构建生产环境目标文件
1. 小程序:`npx builder build`

2. 小游戏:`npx gamebuilder build`
  • 已按照上述步骤在 package.json 中添加了 scripts
# 可以监听项目文件 实时构建
npm run serve

# 构建生产环境目标文件
npm run build