You are viewing documentation for Vaadin Framework 8 and related products View documentation for Vaadin Framework 7 ›
Usage with Polymer CLI · Vaadin
Vaadin Elements - Usage with Polymer CLI

Usage with Polymer CLI

Overview

The generator-polymer-init-vaadin-elements-app is a boilerplate template for creating a new Polymer Application that uses Paper and Vaadin Elements.

The template, which smoothly integrates with the Polymer-CLI tool, produces a fully featured Progressive Web Application (PWA).

Installation

We assume that you already have installed in your system node.js, npm, bower, and polymer-cli tools. Otherwise, please follow the specific instructions of each tool in their website.

Then install the template package globally:

$ npm install -g generator-polymer-init-vaadin-elements-app

Creating the Application

Create a new application with the $ polymer init command, passing the vaadin-elements-app argument:

$ mkdir my-project
$ cd my-project
$ polymer init vaadin-elements-app

It will create a Polymer CLI project structure. In order to know more details abut the project structure, or to check more command options in the tool, please refer to the Polymer CLI documentation.

Developing

The following command serves the app at http://localhost:8080 and provides a basic URL routing for the application:

$ polymer serve

Now, you can modify application files with your favorite editor, and those changes will be automatically reloaded in the browser.

generator polymer init vaadin elements app overview

Testing

The application includes automated tests located in the test directory. To run the tests, run the following command:

$ polymer test

Building

The following command performs HTML, CSS, and JS minimization of the dependencies, and generates the service workers.

$ polymer build

It outputs two variants of the application, one in the build/unbundled folder for HTTP/2+Push compatible servers, and the other output in the build/bundled folder that bundles all the dependencies in a single file. It is compatible with any classic web server.

You can test the build by running the following command:

$ polymer serve build/bundled