2.0.2 • Published 3 years ago

ziu v2.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

ziu

a simple CLI for scaffolding Vue.js/React.js/微信小程序/支付宝小程序/jQuery projects.

Installation

  • Node.js >= 6.4
$ npm install -g ziu

Usage

$ ziu init <project-name>

Example:

$ ziu init test

The command pulls the templates from ziu-templates, and then we list all templates in the repro. Like this: aliapp - 支付宝小程序模板 bdapp - 百度小程序模板 lib-pac - 基于Rollup打包组件和基础库模板 react - a react template with webpack ttapp - 头条/抖音小程序模板 usual - 传统项目模板(use jQuery) vue-3 - 使用vue-cli@3版本的项目模板 weapp - 微信小程序模板

then, prompts for some information, and generates the project at ./test/.

查看已有的项目模板

ziu list

环境变量

  • 每一个模板都有4中环境,development、testing、staging、production
  • 环境变量是以yaml的文件格式编译,在项目根目录下的config文件夹下有5个yaml文件,default.yml、development.yml、testing.yml、staging.yml、production.yml,分别对应4中环境中使用的环境变量;default.yml是默认配置,其他环境的配置会和default.yml中的配置合并

  • 环境变量在JavaScript中获取

yaml中配置的环境变量都存储在process.env.ENV_DATA中:

// 获取当前环境
// 这里并没有使用process.env.NODE_ENV作为环境区分,主要为了避免第三方库依赖process.env.NODE_ENV导致出现异常
const env = process.env.ENV_DATA.PRJ_ENV;

Dev

$ npm run dev

start a local server to development

Testing

generates tesing files

$ npm run testing

build

$ npm run build

generates production files

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.6.4

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago