Use Poi Presets from npm to Skip Configuration

John Lindquist
InstructorJohn Lindquist
Share this video with your friends

Social Share Links

Send Tweet
Published 7 years ago
Updated 6 years ago

Poi provides a helpful list of presets for popular libraries which you can simply npm install and use with the poi --presets flag. By default, Poi uses a built-in Vue preset, but you can leverage he presets to help you try out new libraries such as Svelte, Riot, and Elm.

Instructor: [00:00] POI provides a list of presets, which you can try out here, for example, the poi-preset-svelte. I'll install that in an empty directory, poi-preset-svelte. Then I'll go ahead and create the files I need for a Svelte demo. In app HTML, we'll create a div with a message inside of it.

[00:24] Then, in index.js, import app from my app HTML file, and then create that, so new app where the target is, my document query selector. Remember that POI gives you a template with a root div with an IDF app. I'll select that, and then data, where we set the message to, "Hello from POI."

[00:51] I'll go ahead and run this by saying poi--presets Svelte. That will look up our poi-preset-svelte we installed. You can see it launches it on 4000. I'll open that up, and you can see here we have, "Hello from POI," using the Svelte library.