There are two ways to install and configure polymer in your system:
- The Polymer CLI (Command Line Interface)
- The Bower
Installing Polymer using CLI
- Install the Polymer CLI.
npm install -g polymer-cli
- Create a test folder for Polymer 2.0, and switch to it.
mkdir polymer-20-test cd polymer-20-test
- Initialize your project.
polymer init
- Select
polymer-2-application
. - Serve your project.
polymer serve
Install Polymer from Bower
- Install Bower.
npm install -g bower
- Install the Polymer CLIThe Polymer CLI requires Node.js and npm as well as Bower. For full installation instructions
npm install -g polymer-cli
- Install the latest Polymer 2.0 release from bower
bower install Polymer/polymer#^2.0.0
- Create a test
index.html
file, and add the following in the<head>
tag:
<script src="/bower_components/webcomponentsjs/webcomponents-loader.js"></script>
to load the polyfills<link rel="import" href="/bower_components/polymer/polymer.html">
to import Polymer
- Import and use whichever elements you’d like.
- Serve your project.
polymer serve
0 comments:
Post a Comment