A simple Polymer 3.0 demo app. See it deployed at start-polymer3.firebaseapp.com.
Please use the latest version of Chrome or Safari to view the app. It uses native dynamic imports.
If you have done all this before:
npm install -g polymer-cli@next
git clone https://github.com/PolymerLabs/start-polymer3.git
cd start-polymer3
npm install
polymer serve
Otherwise:
- Set up a development environment for Polymer projects:
- Clone, install and serve the
start-polymer3project locally. - (Optional) Build the
start-polymer3project for production. - (Optional) Deploy the
start-polymer3project.
Before you can serve this project, you will need to install Polymer CLI and its prerequisites.
If you've installed Polymer CLI before, please note that you will need the @next version to work with this project.
When you've installed the prerequisites, run the following command to install the Polymer CLI globally:
npm install -g polymer-cli@next
To clone the project, install its dependencies, and serve locally:
git clone https://github.com/PolymerLabs/start-polymer3.git
cd start-polymer3
npm install
polymer serve
To view the app, open the applications link in the latest version of Chrome or Safari. For example:
~/start-polymer3 > polymer serve
info: 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/start-polymer3/
In the example above, you'd open http://127.0.0.1:8081.
TODO: Finish this section.
To build the start-polymer3 app:
npm install
polymer build
The build is output to build/es6-unbundled. To serve the built app locally:
cd build/es6-unbundled
polymer serve
TODO: Finish this section.
You can deploy a built Polymer app to any web server. Suggestions are:
- Deploy with Firebase.
- TODO: Deploy with Google App Engine.
To deploy the app to your own Firebase project:
-
Install the Firebase CLI tools.
npm install -g firebase-tools firebase login -
From the Firebase console, create a Firebase project.
-
Initialize Firebase in your project folder.
firebase initComplete the Firebase initialization process to set up your project for hosting.
If you are prompted to
- select Firebase CLI features, select Hosting.
- select a default Firebase project, select the project you created from the Firebase console.
- specify a
publicdirectory, you can enterbuild/es6-unbundledto deploy the build configuration supplied with this sample project. - configure as a single-page app, enter
Y. - overwrite
index.html, enterN.
-
In a text editor, open
firebase.jsonfrom your root project folder.hosting.ignoreis a list of files and folders that Firebase will not deploy. Remove thenode_modulesfolder from this list and savefirebase.json.firebase.json: Before
{ "hosting": { "public": "build/es6-unbundled", "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ], "rewrites": [ { "source": "**", "destination": "/index.html" } ] } }firebase.json: After
{ "hosting": { "public": "build/es6-unbundled", "ignore": [ "firebase.json", "**/.*" ], "rewrites": [ { "source": "**", "destination": "/index.html" } ] } } -
Deploy your project with Firebase.
firebase deploy