3.1.11 • Published 5 years ago

omi-cli-test v3.1.11

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

omi-cli

$ npm i omi-cli -g     # install cli
$ omi init my-app      # init project, you can also exec 'omi init' in an empty folder
$ cd my-app            # please ignore this command if you executed 'omi init' in an empty folder
$ npm start            # develop
$ npm run build        # release

npx omi-cli init my-app is also supported(npm v5.2.0+).

Directory description:

├─ config
├─ public
├─ scripts
├─ src
│  ├─ assets
│  ├─ elements    //Store all custom elements
│  ├─ store       //Store all this store of pages
│  ├─ admin.js    //Entry js of compiler,will build to admin.html
│  └─ index.js    //Entry js of compiler,will build to index.html

Project Template

Template TypeCommandDescribe
Base Template(v3.3.0+)omi init my-appBasic omi or omio(IE8+) project template.
TypeScript Template(omi-cli v3.3.0+)omi init-ts my-appBasic template with typescript.
Mobile Templateomi init-weui my-appMobile web app template with weui and omi-router.
SPA Template(omi-cli v3.0.10+)omi init-spa my-appSingle page application template with omi-router.
omi-mp Template(omi-cli v3.0.13+)omi init-mp my-appDeveloping web with mini program template.
MVVM Template(omi-cli v3.0.22+)omi init-mvvm my-appMVVM template.

CLI's auto-created project scaffolding is based on a single-page create-react-app to be converted into a multi-page one, with configuration issues to see create-react-app user guide

About compiled website URL:

Such as in windows:

"scripts": {
  "start": "node scripts/start.js",
  "_build": "node scripts/build.js",
  "build":"set PUBLIC_URL=https://fe.wxpay.oa.com/dv&& npm run _build"
}

In mac os:

"scripts": {
    "start": "node scripts/start.js",
    "_build": "node scripts/build.js",
    "build":"PUBLIC_URL=https://fe.wxpay.oa.com/dv npm run _build",
    "fix": "eslint src --fix"
  },

License

This content is released under the MIT License.