The first step weex learn to create a package weex project web and iOS

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/gwh111/article/details/88993955

The official version https://weex.apache.org/zh/guide/develop/create-a-new-app.html# initialization

The feeling of speaking is quite clear.

We summarize here the integration problems encountered.

 

Create a new project process

cd 到目录

weex create my-project

cd my-project

npm install

There is a warning ( [email protected] The requires Use the peer of WebPACK A @ 2. 1 || || || ^ ^ 2.2.0 2.1.0-Beta-RC IS Installed But none. Use the peer Dependencies Yourself by You MUST the install. ) Ignorable

Elevation start

If you report this error ( npm npm ERR ERR code ELIFECYCLE errno 1 npm ERR [email protected] serve:!!! `WebPACK-dev-Server --env.NODE_ENV Development --progress` npm ERR = Exit Status 1! )

Port number is occupied, you can restart the terminal.

Online search a closed terminal method ( https://blog.csdn.net/mingzznet/article/details/38345875 )

First lsof -i: 8080 to find the port number

lsof -i:8080

Then kill -9 15521

kill -9 15521

I actually closed the terminal restart after it.

 

Packaged into a web

Execution npm run pack: web there will be a release folder, open it inside the html.

npm run pack:web

Execute instructions to complete the next record run

Including other platforms, ios, Andrews, web

Inside that directory, you can run several commands:


  npm start
  Starts the development server for you to preview your weex page on browser
  You can also scan the QR code using weex playground to preview weex page on native

  npm run dev
  Open the code compilation task in watch mode

  npm run ios
  (Mac only, requires Xcode)
  Starts the development server and loads your app in an iOS simulator

  npm run android
  (Requires Android build tools)
  Starts the development server and loads your app on a connected Android device or emulator

  npm run pack:ios
  (Mac only, requires Xcode)
  Packaging ios project into ipa package

  npm run pack:android
  (Requires Android build tools)
  Packaging android project into apk package

  npm run pack:web
  Packaging html5 project into `web/build` folder

  npm run test
  Starts the test runner

To get started:

  cd my-project
  npm start

 

Guess you like

Origin blog.csdn.net/gwh111/article/details/88993955