Installation

You can install Poi globally for instant prototyping like this:

yarn global add poi

# sh
echo "alert('oops')" > index.js && poi -so
# fish
echo "alert('oops')" > index.js ; poi -so

# `poi -so` is a short-hand for `poi --serve --open`

However, for a real-world project you should install Poi locally in your project as a dev dependency:

cd my-project
yarn add poi --dev

Then you can use npx (comes with npm 5.2+) or Yarn to run the locally installed Poi:

yarn poi --serve

You should also add some npm scripts to your package.json to run it easier for everyone in your team:

{
  "private": true,
  "name": "my-app",
  "scripts": {
    "build": "poi --prod",
    "dev": "poi --serve"
  },
  "devDependencies": {
    "poi": "^12.0.0"
  }
}

Now you can run yarn build to bundle your project for production and yarn dev to start a dev server.

Last Updated: 12/8/2018, 9:14:19 AM