On this page:

Install Polymer CLI

Requires npm and Nodejs.

npm install -g polymer-cli

Configure a project for Polymer CLI dev server

  1. Configure Polymer CLI to serve your project locally.

    Create a polymer.json file in your top-level project folder. For example:

    Project folder structure

    bash my-project/ src/ index.html my-project.js package.json polymer.json

    polymer.json

    json { "npm": true, "moduleResolution": "node", "entrypoint": "src/index.html", "shell": "src/my-project.js", }

  2. From your top-level project folder, install npm components if you haven't already done so. Then, run polymer serve:

    bash cd my-project npm install polymer serve

    Polymer CLI starts a local server. To view your served project, open the applications URL. For example:

    ~/my-project > polymer serve info: [cli.command.serve] Files in this directory are available under the following URLs applications: http://127.0.0.1:8081 reusable components: http://127.0.0.1:8081/components/my-project/

    To view the served project in the example above, open http://127.0.0.1:8081.

Text editor

You will need a text editor that does HTML syntax highlighting inside JavaScript template literals.