LitElement's pre-requisites are Node.js, npm, and Polymer CLI.
Install Polymer CLI:
npm install -g polymer-cli
Create a new LitElement project:
mkdir myproject
cd myproject
npm init -y
npm install --save @polymer/lit-element
npm install --save @webcomponents/webcomponentsjs
Create a polymer.json config file, and serve your project:
cd myproject
npm install
echo '{
"npm": true,
"moduleResolution": "node",
"entrypoint": "src/index.html",
"shell": "src/my-project.js",
"extraDependencies": [
"node_modules/@webcomponents/webcomponentsjs/**"
],
"builds": [{
"name": "mybuild",
"bundle": true,
"js": {
"minify": true
}
}]
}' >polymer.json
polymer serve
Build your project, and serve the build locally:
cd myproject
polymer build
polymer serve build/mybuild