Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Extract the POS unbuild package on your computer, you will see the client and server folder

    Image RemovedImage Added

  2. Change to the client directory

    Code Block
    cd client

  3. Depending on the package you was purchased you will see how many client app under this directory
    In this case, there are 3 apps in the package

    Image RemovedImage Added

  4. Go to each directory and run build for the apps
    For example the pos app

    Code Block
    cd pos && npm install && npm run build && cd ../

    The output will be stored in the build directory. In this case is pos/build

    Then do the same way with other apps (if have)
    clickandcollect app

    Code Block
    cd clickandcollect && npm install && npm run build && cd ../

    mobile_pos app

    Code Block
    cd mobile_pos && npm install && npm run build && cd ../
  5. Copy all the built apps to Webpos module
    The mapping for a copy client apps will look like below
    client/<app_name>/build => server/app/code/Magestore/Webpos/build/apps/<app_name>

    Code Block
    cd ../
    rm -rf server/app/code/Magestore/Webpos/build/apps
    mkdir -p server/app/code/Magestore/Webpos/build/apps
    cp client/pos/build server/app/code/Magestore/Webpos/build/apps/pos
    cp client/clickandcollect/build server/app/code/Magestore/Webpos/build/apps/clickandcollect
    cp client/mobile_pos/build server/app/code/Magestore/Webpos/build/apps/mobile_pos

...

Code Block
languagebash
#!/usr/bin/env bash

set -euo pipefail

rm -rf server/app/code/Magestore/Webpos/build/apps/
mkdir -p server/app/code/Magestore/Webpos/build/apps/
cd client
for app_name in client/*; do
    echo "Building app '$app_name'"
    cd "$app_name" \
    && npm install \
    && npm run build \
    && cp -R build "../../app/code/Magestore/build/apps/$app_name" \
    && cd ../
done
echo "Done"

...