Save 45% for a limited time.

Get access to all courses and lessons on egghead today.

Autoplay

    Customize Poi's Default index.html Template

    John LindquistJohn Lindquist

    Poi ships with a sensible default for an index.html template, but it’s easy to override to customize and provide whatever you may need. You can change the title, update links, and even use the underscore templating system.

    webpackwebpack
    htmlHTML 5
    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Transcript

    Transcript

    Instructor: 00:00 You'll notice in the DevTools, when Poi is running, there's a div with an id of app in here. Then it handles all the manifest, vendor, and client webpack stuff for you, but if you want to customize any of this stuff, you can just create a file called index.ejs.

    00:14 Then I'll create a div with an id of app. I'll put some text above it, so I'll say above, and some text below it -- I'll say below. Because I changed the template, I need to stop and start Poi again, so I'll run Poi. You can see now we have above, My awesome app, and below, which is reflected in the DevTools.

    00:37 If you need to configure anything in the head or anything outside of the body, then just delete the entire thing. I'll generate a page using Emmet, then I'll change the title to My awesome app, make sure I add back a div element with an id of app, hit save. You can see the title is now My awesome app, and the head changed to My awesome app, and webpack is still injecting all the scripts we need.

    Discuss

    Discuss