This project is a simple app template using LitElement and Redux written in Typescript. It makes heavy use of Redux Tool Kit to do a lot of the wiring vs using redux primatives directly. Routing is provided via lit-redux-router
Inspiration for this project comes from lit-element-starter-ts and the pwa-starter-kit-hn repositories.
In it's current state, the production build will NOT work with code splitting. EG: Code that does dynamic improts.
Install dependencies:
npm i
To build for dev
npm run build
To watch files and rebuild when the files are modified, run the following command in a separate shell:
npm run build:watch
Both the TypeScript compiler and lit-analyzer are configured to be very strict.
You may want to change tsconfig.json
to make them less strict.
This sample uses Karma, Chai, Mocha, and the open-wc test helpers for testing. See the open-wc testing documentation for more information.
Tests can be run with the test
script:
npm test
This sample uses open-wc's es-dev-server for previewing the project without additional build steps. ES dev server handles resolving Node-style "bare" import specifiers, which aren't supported in browsers. It also automatically transpiles JavaScript and adds polyfills to support older browsers.
To run the dev server and open the project in a new browser tab:
npm run serve
There is a development HTML file located at /dev/index.html
that you can view
at http://localhost:8000/dev/index.html.
To build the site, run:
npm run prod
To serve the site locally, run:
npm run prod:serve
To watch the site files, and re-build automatically, run:
npm run prod:watch
The site will usually be served at http://localhost:8000.